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

52.write a “Hello World” program in “c” without using a semicolon? 53.Give a method to count the number of ones in a 32 bit number? 54.write a program that print itself even if the source file is deleted? 55.Given an unsigned integer, find if the number is power of 2?

9 Answers  


Function which gives a pointer to a binary trees const an integer value at each code, return function of all the nodes in binary tree.?

0 Answers   Infosys,


How do you define a string?

0 Answers  


An organised method of depicting the use of an area of computer memory used to signify the uses for different parts of the memory a) swap b) extended memory c) memory map d) all of the above

0 Answers  


Explain bit masking in c?

0 Answers  






how to get starting address of a running C program

3 Answers  


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

0 Answers  


What is #line in c?

0 Answers  


int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;

0 Answers  


What are bitwise shift operators in c programming?

0 Answers  


what is the output of below code int x=8,y; x>>=2; y=x; what is y value. NOTE:EXPLANATION IS COMPALSARY with binary bits

2 Answers   Wipro,


What is a buffer in c?

0 Answers  


Categories