BinaryByter
i wanted to show a fuller example
BinaryByter
👆🏼👆🏼👆🏼
/warn you aren't guaranteed to get an answer
Anonymous
Write a type declaration for student record for a student the record contained is name, surname, course,DOB(day,month,year)
Anonymous
Can any1 help me with this please.
Dima
Read the rules please
Dima
at least try doing this and we’ll help
MᏫᎻᎯᎷᎷᎬᎠ
.
Anonymous
Hi
klimi
Hi
klimi
welcome
SamuraiLeon $3 🐧🐧🐧🌊🔐
Helo folks..
Dima
welcome
klimi
Hello
Anonymous
Hey...can anyone tell me what's the difference between #define and constant ?
klimi
#define is preprocesor thing
klimi
and constant is actually in your code
Anonymous
#define is preprocesor thing
Still ..it's for declaring constant.. Why we wouldn't use #define everytime
klimi
if you do like
klimi
const int A= 5; cout « A;
klimi
this is actuall code
klimi
if you use #define
klimi
#define A=5 cout « A; produces cout «5;
Anonymous
In both the cases...output is 5 Isn't it..,?
Anonymous
#define A=5 cout « A; produces cout «5;
Sorry..but still my doubt is not cleared..can you please elaborate more
Anonymous
I'm just asking.. Why I use const if I have #define.. Or why I use #define if I already have const
Anonymous
I don't know different situations for both
klimi
Anonymous
Kk
Mihail
Hey...can anyone tell me what's the difference between #define and constant ?
define is a pre-processor thing which isn't a good idea as it could cause issues. what you really should be using is: constexpr var = 5;
Mihail
because it'll actually be treated as a variable and properly used in diffrent contexts
Anonymous
I'm Human !
Anonymous
I'm Human !
Until proven otherwise, you are not
🐰🐾 سمیه
I don't understand the highlighted part, especially the line showed by arrow. please explain it to me.
🐰🐾 سمیه
It's C code, besides what's the relevance?
🐰🐾 سمیه
yes I know, but how it's calculated is what I dont
Anonymous
Anonymous
Its not a tertinary operator bro
Anonymous
It's just a statement ending with semicolon
Anonymous
Although it's assigning value to variable leap at the point it calculate it by comparison
Anonymous
سمیه i wanna know u
Anonymous
If u r programmers
Anonymous
If u r programmers
Programmers..? 😐😕 What the 's' is doing here
🐰🐾 سمیه
So, all ==, &&, != and || operators have higher precedence than = . correct? and in this case, if year%4 == 0 and year%100 != 0 both were true, what heppens ?
Anonymous
I don't understand the highlighted part, especially the line showed by arrow. please explain it to me.
You need to understand a leap year. That statement is just checking if the year parameter is a leap year. The year is said to be a leap year if: - is divisible by 4 - is not divisible by 100 - is divisible by 400
🐰🐾 سمیه
If u r programmers
as a matter of fact, I'm not
Anonymous
So, all ==, &&, != and || operators have higher precedence than = . correct? and in this case, if year%4 == 0 and year%100 != 0 both were true, what heppens ?
If it's && ..means..both conditions have to be true . If it's || then atleast one condition have to be true
Anonymous
Year %400 = 0 is leap
Anonymous
Or year %4=0 but year%100 not = 0 is leap
Anonymous
supposing it's true, then what is to be assigned to leap?
Suppose year value is 2004.. Then 2004%400 which is 0 So value of leap is 1
Anonymous
There is an or operation. If one is true it won’t check for the other
Anonymous
And % represent remainder..not quotinent
Anonymous
It's a worthless channel ! in this channel 7,145 member ! i think no ones are interested in programming !
Anonymous
🐰🐾 سمیه
so, values of leap could be just 0 or 1, true ?
olli
It's a worthless channel ! in this channel 7,145 member ! i think no ones are interested in programming !
It's a group, not a channel.. What do you want to discuss? There are enough people interessted in programming.
Anonymous
It's can be true or false
Anonymous
so, values of leap could be just 0 or 1, true ?
Yes it can't be both at same time
Anonymous
Am i R8ght?
🐰🐾 سمیه
So why in the definition of daytab above, it could be 2 ?
Anonymous
Am i R8ght?
I'm also noob
Shivam
I'm also noob
And you lost the game as well
Shivam
Shivam
#ot
Anonymous
Nvm
Come in I
Anonymous
Ib