struct point
{
int x;
int y;
};
struct point origin,*pp;
main()
{
pp=&origin;
printf("origin is(%d%d)\n",(*pp).x,(*pp).y);
printf("origin is (%d%d)\n",pp->x,pp->y);
}
Answer / susie
Answer :
origin is(0,0)
origin is(0,0)
Explanation:
pp is a pointer to structure. we can access the elements of
the structure either with arrow mark or with indirection
operator.
Note:
Since structure point is globally declared x & y are
initialized as zeroes
Is This Answer Correct ? | 4 Yes | 0 No |
char *someFun1() { char temp[ ] = “string"; return temp; } char *someFun2() { char temp[ ] = {‘s’, ‘t’,’r’,’i’,’n’,’g’}; return temp; } int main() { puts(someFun1()); puts(someFun2()); }
main() { int a=10,*j; void *k; j=k=&a; j++; k++; printf("\n %u %u ",j,k); }
int a = 10 + 10 .... ,... A = A * A What would be the value of A? The answer is 120!! Could anyone explain this to me.
2 Answers Bosch, eInfochips, HCL, IHCL,
Write a routine that prints out a 2-D array in spiral order
main() { int i, j; scanf("%d %d"+scanf("%d %d", &i, &j)); printf("%d %d", i, j); } a. Runtime error. b. 0, 0 c. Compile error d. the first two values entered by the user
What is "far" and "near" pointers in "c"...?
main() { char *p; printf("%d %d ",sizeof(*p),sizeof(p)); }
‎#define good bad main() { int good=1; int bad=0; printf ("good is:%d",good); }
main() { int i=400,j=300; printf("%d..%d"); }
Write a C program to print ‘Campus Force training’ without using even a single semicolon in the program.
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
{ int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }