Why can't we initialise member variable of a strucutre



Why can't we initialise member variable of a strucutre..

Answer / thunder

Because at the time of creation of structures, memory is not
allocate in the memory block.Memory will be allocated at the
time of creation of structure instance only, that's y we are
not able to initialize the structure members.

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More C Interview Questions

Do you know the difference between exit() and _exit() function in c?

0 Answers  


What is the use of pragma in embedded c?

0 Answers  


what is output? main() { #define SQR(x) x++ * ++x int i = 3; printf(" %d %d ",SQR(i),i * SQR(i)); } a)9 27 b)35 60 c)20 60 d)15 175

5 Answers   Wipro,


a value that does not change during program execution a) variabe b) argument c) parameter d) none

0 Answers  


what is pointer ? what is the use of pointer?

6 Answers   Infosys,






Write a program to generate prime factors of a given integer?

9 Answers   Microsoft,


Where does the name "C" come from, anyway?

0 Answers   Celstream,


What is a null pointer assignment error? What are bus errors, memory faults, and core dumps?

0 Answers   Aspire, Infogain,


Why is c so powerful?

0 Answers  


#include<stdio.h> int f(int,int); int main() { printf("%d",f(20,1)); return 0; } int f(int n,int k) { if(n==0) return 0; else if(n%2)return f(n/2,2*k)+k; else return f(n/2,2*k)-k; } how this program is working and generating output as 9....?

1 Answers  


Are enumerations really portable?

0 Answers  


What is page thrashing?

0 Answers  


Categories