@Abhi:
Answers:
1. whenever a 'const' qualifier is added previously to a variable 
declaration it means that the value of the variable is automatically 
initialized to '0'(because of the 'auto' type of the const variable)  and 
cannot be changed in any of the following assignment statements to the const 
variable.

2.
Here for the structure struct s1 since the entire structure is ending within 
8 bytes no padding is done which means
s1:     [char a]
           1byte
but for the structure struct s2 consider the following:
s2:     [             char a
                        1byte
           ------ int a-------
           ------4bytes----]
so here the concept of padding comes to make all the variable aligned in 
even boundaries and so the structure after aligning will look as:
s2:     [ ------ char b----
            ------4byte-----
           ------ int a-------
           ------4bytes----]

so the size of strcut s2 will be 8bytes..........

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/FoHpgvrjnm0J.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to