C Programming - Structures, Unions, Enums - Discussion
Discussion Forum : Structures, Unions, Enums - True / False Questions (Q.No. 11)
11.
On declaring a structure 0 bytes are reserved in memory.
Discussion:
20 comments Page 2 of 2.
Sagar said:
1 decade ago
Yes sizeof(struct) is giving memory of data types declared in it. It doesn't mean that memory is allocated in stack section.
Avishek said:
1 decade ago
When a structure is declared no memory space is allocated till a variable is declared.
Then how can the answer be false ?
Then how can the answer be false ?
Umesha krishnegowda said:
1 decade ago
NO, answer is not correct. Because after structure variable is declared then only memory will allocated.
Amit pawar. said:
1 decade ago
the memory will be allocated only after structure variables are declared.
then how the answer is false.
then how the answer is false.
Harshith M L said:
1 decade ago
Yep only after a variable is declared memory will be allocated till then no memory will be allocated.
Abc said:
1 decade ago
Thank you very much @Sampath. Now I clearly get the def 's of structure declaration and definition.
Ingale Yogesh said:
1 decade ago
Memory is allocated only when an instance of structure is created, till no memory is allocated.
Nikhil said:
1 decade ago
If mem is allocated when struct is declare can you tell me how many bytes declare at that time.
Naresh said:
1 decade ago
Here Structure reserved one bytes when it declare without any member declare inside it.
Tanikachalamaji266@gmail.com said:
5 years ago
When structure variable is created then, memory will be allocated.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers