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=10, j=2; int *ip= &i, *jp = &j; int k = *ip/*jp; printf(ā€œ%dā€,k); }

1 Answers  


main() { int i=10; i=!i>14; Printf ("i=%d",i); }

1 Answers  


main() { printf("%d", out); } int out=100;

3 Answers  


#include <stdio.h> main() { char * str = "hello"; char * ptr = str; char least = 127; while (*ptr++) least = (*ptr<least ) ?*ptr :least; printf("%d",least); }

1 Answers  


void main() { static int i; while(i<=10) (i>2)?i++:i--; printf(ā€œ%dā€, i); }

2 Answers  






could you please send the program code for multiplying sparse matrix in c????

0 Answers  


main() { struct date; struct student { char name[30]; struct date dob; }stud; struct date { int day,month,year; }; scanf("%s%d%d%d", stud.rollno, &student.dob.day, &student.dob.month, &student.dob.year); }

1 Answers  


void main() { int *i = 0x400; // i points to the address 400 *i = 0; // set the value of memory location pointed by i; }

2 Answers  


Write a program that produces these three columns sequence nos. using loop statement Sequence nos. Squared Squared + 5 1 1 6 2 4 9 3 9 14 4 16 21 5 25 30

1 Answers   GoDB,


main() { int i = 0xff ; printf("\n%d", i<<2); } a. 4 b. 512 c. 1020 d. 1024

2 Answers   HCL,


writte a c-programm to display smill paces

2 Answers  


Write a program to check whether the number is prime and also check if it there i n fibonacci series, then return true otherwise return false

1 Answers   Cognizant, lenovo,


Categories