#include<stdio.h>
main()
{
struct xx
{
int x;
struct yy
{
char s;
struct xx *p;
};
struct yy *q;
};
}
Answers were Sorted based on User's Feedback
Answer / susie
Answer :
Compiler Error
Explanation:
in the end of nested structure yy a member have to be
declared.
| Is This Answer Correct ? | 8 Yes | 0 No |
Answer / dayana benny
The structure yy is nested within structure xx. Hence, the elements are of yy are to be accessed through the instance of structure xx, which needs an instance of yy to be known. If the instance is created after defining the structure the compiler will not know about the instance relative to xx. Hence for nested structure yy you have to declare member.
| Is This Answer Correct ? | 3 Yes | 0 No |
Code for 1>"ascii to string" 2>"string to ascii"
1 Answers Aricent, Global Logic,
main() { char s[ ]="man"; int i; for(i=0;s[ i ];i++) printf("\n%c%c%c%c",s[ i ],*(s+i),*(i+s),i[s]); }
why is printf("%d %d %d",i++,--i,i--);
main() { char *str1="abcd"; char str2[]="abcd"; printf("%d %d %d",sizeof(str1),sizeof(str2),sizeof("abcd")); }
What is the output for the program given below typedef enum errorType{warning, error, exception,}error; main() { error g1; g1=1; printf("%d",g1); }
void main() { char a[]="12345\0"; int i=strlen(a); printf("here in 3 %d\n",++i); }
int i,j; for(i=0;i<=10;i++) { j+=5; assert(i<5); }
Ramesh’s basic salary is input through the keyboard. His dearness allowance is 40% of basic salary, and house rent allowance is 20% of basic salary. Write a program to calculate his gross salary.
main() { int i=4,j=7; j = j || i++ && printf("YOU CAN"); printf("%d %d", i, j); }
What are segment and offset addresses?
main() { printf("%x",-1<<4); }
main() { int i =0;j=0; if(i && j++) printf("%d..%d",i++,j); printf("%d..%d,i,j); }