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
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 |
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 |
What are c header files?
write a programe to find the factorial of given number using recursion
Write a program for deleting duplicate elements in an array
What is the difference between array and pointer in c?
how to find sum of 5 digits in C?
Is it better to use a macro or a function?
what is an inline fuction??
how can i sort numbers from ascending order and descending order using turbo c..
Can you explain the four storage classes in C?
How to Throw some light on the splay trees?
#include<stdio.h> main() {int i=1;j=1; for(;;) {if(i>5) break; else j+=1; printf("\n%d",j) i+=j; } }
what would be the output of the following program? main() { int k = 123; char *ptr; ptr = &k; printf("%d",*ptr); }