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 |
How to declare pointer variables?
how can i calculate mean,median,mode by using c program
without using control structures and control structures find the max and min of given 2 nos
What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?
how should functions be apportioned among source files?
what is the similarities between. system call and library function?
How to implement variable argument functions ?
What the advantages of using Unions?
in case any function return float value we must declare a) the function must be declared as 'float' in main() as well b) the function automatically returned float values c) function before declared 'float' keyword d) all the above
void main() { int a[]={1,2,3,4,5},i; for(i=0;i<5;i++) printf("%d",a++); getch(); }
#define MAX 3 main() { printf("MAX = %d \n",MAX ); #undef MAX #ifdef MAX printf("Vector Instituteā); #endif
What is a memory leak? How to avoid it?