You should have learned then that the "nit picking" is in an effort to keep people clear on what's going on. For example, there is nothing illegal with the following line of code:I did learn something today, quzah, that did surprise me. You know what it is? The people that are smart enough to help nitpick the people doing their best to help. I also learned that these forums are started with good intentions but end up being ruined by people that have no social life because all they do is insult others.It's perfectly legal code. It compiles. It runs. However, it's not safe code. Should I not "nit pick" people here and tell them it's fine to use this? Should I suggest people ditch other input methods when they want to just get a line from the user, in favour of gets? I mean, it's legal C.Code:gets( foo );
Look at your sig. You make it a point of how 1337 you are, because you're a "teenager" who is "correcting" people. It's apparently some point of pride you've got, but you yourself can't handle being corrected. You've been corrected a number of times this thread, and it makes you angry. No? Let's quote you some more:Now then...Originally Posted by Brad0407
The standard defines the size of a character will always evaluate to 1. ALWAYS. Here, I'll quote it, since you've apparently never seen the standard:Originally Posted by Brad0407There you have it, sizeof char will always evaluate to 1. That's the entire point of sizeof. Clearly you don't understand the point of the operator.6.5.3.4 The sizeof operator
Constraints
1 The sizeof operator shall not be applied to an expression that has function type or an
incomplete type, to the parenthesized name of such a type, or to an expression that
designates a bit-field member.
Semantics
2 The sizeof operator yields the size (in bytes) of its operand, which may be an
expression or the parenthesized name of a type. The size is determined from the type of
the operand. The result is an integer. If the type of the operand is a variable length array
type, the operand is evaluated; otherwise, the operand is not evaluated and the result is an
integer constant.
3 When applied to an operand that has type char, unsigned char, or signed char,
(or a qualified version thereof) the result is 1. When applied to an operand that has array
type, the result is the total number of bytes in the array.84) When applied to an operand
that has structure or union type, the result is the total number of bytes in such an object,
including internal and trailing padding.
I suspect the reason masking off the lower portion of a multi-byte character wasn't mentioned by Prelude is because it was irrelevant to this discussion. It's just an attempt at you to prove something to people who don't care about you. I don't have time to sit around and cheer you up with little strokes to your ego. I do have time to point out when people don't understand things, like the fact that the standard denotes that CHAR_BIT is the number of bits bytes, and not just 8.
Quzah.