Is the below things valid & where it will be stored in
memory layout ?
static const volatile int i;
register struct { } ;
static register;

Answers were Sorted based on User's Feedback



Is the below things valid & where it will be stored in memory layout ? static const volatile i..

Answer / guest

1.static const volatile int i;
is valid cos it is possible to declare a variable with
multiple qualifiers.

2.register struct a{ } ; is invalid but it will be valid
when u doesnt have body of the structure.

ie., struct a;

3.static register int i; is also invalid cos, here
different storage classes are assigned to a single
variable.

Is This Answer Correct ?    5 Yes 0 No

Is the below things valid & where it will be stored in memory layout ? static const volatile i..

Answer / banavathvishnu

register struct test
{
int i;
char c;
float f;
};

int main()
{
struct test t;
t.c = 'v';
printf("%c",t.c);


getch();
}
The above code is valid
The below code is invalid

register struct test
{
};

int main()
{
struct test t;
t.c = 'v';
printf("%c",t.c);


getch();
}

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More C Interview Questions

What are c header files?

0 Answers  


write a programe to find the factorial of given number using recursion

3 Answers  


Write a program for deleting duplicate elements in an array

3 Answers   Subex,


What is the difference between array and pointer in c?

0 Answers  


how to find sum of 5 digits in C?

4 Answers  






Is it better to use a macro or a function?

0 Answers  


what is an inline fuction??

2 Answers  


how can i sort numbers from ascending order and descending order using turbo c..

1 Answers  


Can you explain the four storage classes in C?

0 Answers   TCS,


How to Throw some light on the splay trees?

0 Answers  


#include<stdio.h> main() {int i=1;j=1; for(;;) {if(i>5) break; else j+=1; printf("\n%d",j) i+=j; } }

7 Answers   HCL,


what would be the output of the following program? main() { int k = 123; char *ptr; ptr = &k; printf("%d",*ptr); }

4 Answers  


Categories