Timeline for placement of structs in code
Current License: CC BY-SA 3.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 6, 2014 at 0:19 | comment | added | Lucas | Thanks for helping out abelinux and kareem! Yes, that's what i tried to do except I added typedef in front of the struct. | |
Dec 6, 2014 at 0:17 | vote | accept | Lucas | ||
Dec 5, 2014 at 17:07 | comment | added | abelinux | Uuups! Now I realize the difference. Thanks! | |
Dec 5, 2014 at 17:04 | comment | added | kzidane | @abelinux I never declared a variable of a struct type before the struct's definition. I declared the struct itself. | |
Dec 5, 2014 at 16:57 | comment | added | abelinux |
ah.. Now I see what @Lucas was asking for... I misread his question (sorry about that, @Lucas!). @Kareem: is it posible that your example code, as it is, would result in error? As per " if you're trying to declare a variable of a struct type before it's defined, that'll be an error since the size of the struct will be unknown at this point." Shouldn't it be done exactly the other way around? (I mean, first // definition and only then // declaration ). (No "tricky question" here, just not totally sure =P)
|
|
Dec 5, 2014 at 10:11 | history | answered | kzidane | CC BY-SA 3.0 |