Is this code legal?

int *ptr;

ptr = (int *) 0x400;



Is this code legal? int *ptr; ptr = (int *) 0x400;..

Answer / susie

Answer :

Yes

Explanation:

The pointer ptr will point at the integer in the
memory location 0x400.

Is This Answer Correct ?    17 Yes 2 No

Post New Answer

More C Code Interview Questions

void main() { int i; char a[]="\0"; if(printf("%s\n",a)) printf("Ok here \n"); else printf("Forget it\n"); }

3 Answers   Accenture,


How do you sort a Linked List (singly connected) in O(n) please mail to pawan.10k@gmail.com if u can find an anser...i m desperate to knw...

6 Answers   Microsoft, MSD, Oracle,


main() { int c = 5; printf("%d", main||c); } a. 1 b. 5 c. 0 d. none of the above

2 Answers   HCL,


void main() { int i=5; printf("%d",i+++++i); }

3 Answers  


how can i cast a char type array to an int type array

2 Answers  






#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }

2 Answers  


main() { int i=300; char *ptr = &i; *++ptr=2; printf("%d",i); }

4 Answers   CSC,


#include<stdio.h> main() { FILE *ptr; char i; ptr=fopen("zzz.c","r"); while((i=fgetch(ptr))!=EOF) printf("%c",i); }

1 Answers  


Derive expression for converting RGB color parameters to HSV values

1 Answers  


find simple interest & compund interest

2 Answers  


Sorting entire link list using selection sort and insertion sort and calculating their time complexity

1 Answers   Infosys, Microsoft, NetApp,


can u give me the c codings for converting a string into the hexa decimal form......

1 Answers  


Categories