Content deleted Content added
Reverted 1 edit by 2402:8100:2013:B102:51A8:BC54:4C1E:245B (talk): Don't delete talk page posts without good reason. (TW) |
Tag: |
||
(10 intermediate revisions by 6 users not shown) | |||
Line 1:
{{lowercase title}}
{{Talkheader}}
{{WikiProject
{{WikiProject C/C++|importance=High}}
}}
== Article or redirect? ==
Line 21 ⟶ 23:
:"''For example, common Internet protocols rely on the fact that C compilers insert padding between struct fields in predictable ways [...]''"
Is this an example of [[type punning]]? --[[User:Abdull|Abdull]] ([[User talk:Abdull|talk]]) 22:52, 2 January 2010 (UTC)
:I don't think so. I think it was ''intended'' for uses such as those shown in the example, and not, as ''Type punning'' characterized it{{mdash}}a ''subversion''. See [[#Stuctural padding]] below. — [[User:Cpiral|<
== Call by reference or call by value? ==
Line 33 ⟶ 35:
*The internal alignment of data members is not unique to the C struct. There is an analogous dynamic that also "works as expected" concerning subclassing in C++. That said it is very interesting that even if a C compiler is run "unaligned" it will always align (don't say "pad"?) struct members ''inside'' the struct, guaranteeing this manipulation by a sub-struct of quantity N-last elements manipulating its containing struct of N elements.
Salient internals for our lead section are the '''size''' (as mentioned), and the method of '''chaining''' the members of a C struct to one another.
— [[User:Cpiral|<
== Declare/define ==
Line 71 ⟶ 73:
In the examples, this uses the variable "point" but also talks about pointers. It can get confusing to know which one is being referred. Perhaps changing the arbitrary name of the variable to some like "___location" might make the example clearer. <small class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/199.116.175.88|199.116.175.88]] ([[User talk:199.116.175.88|talk]]) 12:53, 7 May 2015 (UTC)</small><!-- Template:Unsigned IP --> <!--Autosigned by SineBot-->
Also, there is a line of code in the article {ie. typedef struct point point; } that has two words 'point point'. This is sort of like the life story of many documents --- introducing confusing things without explaining it. To the newcomer of the language, they will probably have no idea what that means. It is also off-putting for newcomers when confusing details or code like that is just placed there, without some kind of explanation - such as this style follows some kind of convention. [[User:KorgBoy|KorgBoy]] ([[User talk:KorgBoy|talk]]) 23:33, 3 June 2018 (UTC)
== What directly corresponds data type the Assembly Language has? ==
|