struct Foo
{
char *pName;
};
main()
{
struct Foo *obj = malloc(sizeof(struct Foo));
clrscr();
strcpy(obj->pName,"Your Name");
printf("%s", obj->pName);
}
a. Your Name
b. compile error
c. Name
d. Runtime error
Answers were Sorted based on User's Feedback
void main() { void *v; int integer=2; int *i=&integer; v=i; printf("%d",(int*)*v); }
What is the output for the following program main() { int arr2D[3][3]; printf("%d\n", ((arr2D==* arr2D)&&(* arr2D == arr2D[0])) ); }
main( ) { char *q; int j; for (j=0; j<3; j++) scanf(“%s” ,(q+j)); for (j=0; j<3; j++) printf(“%c” ,*(q+j)); for (j=0; j<3; j++) printf(“%s” ,(q+j)); }
main() { int i; float *pf; pf = (float *)&i; *pf = 100.00; printf("\n %d", i); } a. Runtime error. b. 100 c. Some Integer not 100 d. None of the above
what is brs test reply me email me kashifabbas514@gmail.com
What is the hidden bug with the following statement? assert(val++ != 0);
To reverse an entire text file into another text file.... get d file names in cmd line
main() { int i = 0xff ; printf("\n%d", i<<2); } a. 4 b. 512 c. 1020 d. 1024
How to palindrom string in c language?
main() { int i=300; char *ptr = &i; *++ptr=2; printf("%d",i); }
void main() { static int i; while(i<=10) (i>2)?i++:i--; printf(“%d”, i); }
#include<conio.h> main() { int x,y=2,z,a; if(x=y%2) z=2; a=2; printf("%d %d ",z,x); }