void main()
{
int *i = 0x400; // i points to the address 400
*i = 0; // set the value of memory location pointed by i;
}
Answers were Sorted based on User's Feedback
Answer / amit kumar kunwar
as i is pointing to the address 400 and getting assigned a value of 0. this code is working perfectly. hence the Output is 0 for this code.
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / susie
Answer :
Undefined behavior
Explanation:
The second statement results in undefined behavior because
it points to some location whose value may not be available
for modification. This type of pointer in which the
non-availability of the implementation of the referenced
location is known as 'incomplete type'.
Is This Answer Correct ? | 0 Yes | 1 No |
void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }
Find the largest number in a binary tree
# include <stdio.h> int one_d[]={1,2,3}; main() { int *ptr; ptr=one_d; ptr+=3; printf("%d",*ptr); }
writte a c-programm to display smill paces
main() { extern int i; i=20; printf("%d",sizeof(i)); }
What is the difference between proc means and proc tabulate ? explain with a simple example when you have to use means or tabulate?
void main() { int i=i++,j=j++,k=k++; printf(“%d%d%d”,i,j,k); }
How will you print % character? a. printf(“\%”) b. printf(“\\%”) c. printf(“%%”) d. printf(“\%%”)
main() { int i=400,j=300; printf("%d..%d"); }
void main() { unsigned giveit=-1; int gotit; printf("%u ",++giveit); printf("%u \n",gotit=--giveit); }
There were 10 records stored in “somefile.dat” but the following program printed 11 names. What went wrong? void main() { struct student { char name[30], rollno[6]; }stud; FILE *fp = fopen(“somefile.dat”,”r”); while(!feof(fp)) { fread(&stud, sizeof(stud), 1 , fp); puts(stud.name); } }
Code for 1>"ascii to string" 2>"string to ascii"
1 Answers Aricent, Global Logic,