A
aarklon
1) why this program gives o/p as variable = 123 value = 0
does it mean that if a variable is not known the pre processor treats
it as zero
#include<stdlib.h>
#include<stdio.h>
#if var == 0
int variable = 123;
#endif
int main (void)
{
int value=0;
printf("\n variable = %d value = %d",variable,value);
puts ("");
return(EXIT_SUCCESS);
}
2)
#include<stdlib.h>
#include<stdio.h>
int main(void)
{
struct st
{
int i;
struct st *j;
}t1,t2;
t1.i = 123;
t2.i = 456;
t1.j = &t2;
t2.j = &t1;
printf("\n %d %d",*t2.j,*t1.j);
puts("");
return(EXIT_SUCCESS);
}
123 -1079205560
why i am not getting o/p as 123 456
or why i am not getting 456 in the o/p.
3) printf("\n sizeof(volatile) === %d",(int)sizeof(volatile));
printf("\n sizeof(const) === %d",(int)sizeof(const));
why both these questions are giving o/p as 4 on my machine..???.
does this mean that it is printing the size of int on my
machine....????
does it mean that if a variable is not known the pre processor treats
it as zero
#include<stdlib.h>
#include<stdio.h>
#if var == 0
int variable = 123;
#endif
int main (void)
{
int value=0;
printf("\n variable = %d value = %d",variable,value);
puts ("");
return(EXIT_SUCCESS);
}
2)
#include<stdlib.h>
#include<stdio.h>
int main(void)
{
struct st
{
int i;
struct st *j;
}t1,t2;
t1.i = 123;
t2.i = 456;
t1.j = &t2;
t2.j = &t1;
printf("\n %d %d",*t2.j,*t1.j);
puts("");
return(EXIT_SUCCESS);
}
123 -1079205560
why i am not getting o/p as 123 456
or why i am not getting 456 in the o/p.
3) printf("\n sizeof(volatile) === %d",(int)sizeof(volatile));
printf("\n sizeof(const) === %d",(int)sizeof(const));
why both these questions are giving o/p as 4 on my machine..???.
does this mean that it is printing the size of int on my
machine....????