Talk:C Programming/Variables
Add topic| This is the discussion page for discussing improvements to the C Programming/Variables page. | |||
Textbook policies
|
|||
| Archives: 1 | |||
C level one doubt
[edit source]main() { int a=5,b=2; printf("%d", a+++b); }
what will be the output?? — Preceding unsigned comment added by 115.241.34.90 (talk • contribs)
- You could just try it. It outputs 7. I guess the question is whether
a+++bis interpreted asa++ +b(it is), or asa+ ++b. This sort of question never occurs to me because I make effective use of whitespace when I write code. Ambiguous code is hard to maintain, and is therefore bad code. --Jomegat (discuss • contribs) 15:36, 22 September 2011 (UTC)
Contents/In this section
[edit source]At the end of the page there is a section about Contents and In this section These do not appear correct as they mention arrays, which are not discussed there. MadCowpoke (discuss • contribs) 05:52, 21 May 2012 (UTC)
missing int8_t, uint16_t, etc.
[edit source]Hi! I find it more and more important to think about different processor architectures (16 bit, 32 bit, 64 bit...). In general it's a good idea to determine how "big" your integer variables need to be. Therefore I think it might be good to mention these specific integer data types.
Further more, it should be shown that integer variables can be split bitwise. Example:
- uint16_t nibble1:4, nibble2:4, nibble3:4, nibble4:4;
- uint8_t bit0:1, bit1:1, threebits:3;
What do you think about this? Maybe it's not that important for a beginner's guide... I don't know... --Lexikorn (discuss • contribs) 07:22, 8 January 2023 (UTC)
- @Lexikorn: The C ISO standards declare the
uintN_ttypes optional. I think this chapter is really too early to address such details. ‑‑ Kai Burghardt (discuss • contribs) 17:44, 10 January 2023 (UTC)