When was bool added to c




















It's really based on interest from our users. Where we've received many requests for certain C99 features, we've tried to implement them or analogues.

If there are other C99 features that you'd find useful in your work, let us know! We don't hear much from our C users, so speak up and make yourselves heard. Tuesday, October 4, PM. Igor Tandetnik. Wednesday, October 5, PM. Pavel, I think it is correct. Sergey, The links are helpful. Thanks very much. Pavel, Thanks, I checked stdbool. Sunday, October 2, PM. Bob Sun wrote:. Tuesday, October 4, AM.

Tim, This is important. Could you provide a link to a Microsoft official statement on this point? Wayne, Thanks for the link and information. Wayne, These links are informative. Igor, I see it, thanks for the answer. Active Oldest Votes.

Improve this answer. AnT AnT k 39 39 gold badges silver badges bronze badges. There's a new ISO C standard, published in after this answer was posted. Geremia: No. In C each addressable object has to occupy at least 1 byte. Dai Your remarks deserve to be a completely separate SO question.

Josh Kelley Josh Kelley As to why, it is to allow it ot be undefined and redefined where its definition might cause a clash with legacy code. Rob Rob 5, 5 5 gold badges 38 38 silver badges 61 61 bronze badges.

Note that the behavior of the typedef will be different from that of the C99 bool , and also different from that of many compilers' bit types. No, there is no bool in ISO C Nathan Campos BobbyShaftoe BobbyShaftoe For practical purposes, does it really matter so long as there is still no decent compiler support?

Even gcc didn't have half of C99 features until recently, and MSVC doesn't have most of them, and probably never will I don't use or really plan to use C99 and I think many feel the same way. BobbyShaftoe: The original poster explicitly said in a comment that C90 was an example.

Sri Harsha Chilakapati The initial values are entirely unnecessary. KeithThompson Initial values may be unnecessary, but this answer chooses them in a very elegant way, not with arbitrary values, but using the languages' own semantics and letting the compiler decide.

There's no decision for the compiler to make; it must obey the semantics defined by the language. KeithThompson: I don't think they're obfuscated, I guess the author's intention was to choose the most "natural" values: false is set to whatever value the language says an inequality should be evaluated to, and true to its "opposite" again, whatever that is.

MestreLion: Anyone who knows C knows the numeric values of false and true. Anyone who doesn't know C is not the expected audience for C code. And as I said, C has had a built-in Boolean type since the previous millennium. Show 1 more comment. C99 defines bool, true and false in stdbool. Robert 6, 4 4 gold badges 29 29 silver badges 39 39 bronze badges. Neha Gangwar Neha Gangwar 7 7 silver badges 13 13 bronze badges.

No such thing, probably just a macro for int. Nice with -1's According to wikipedia the only compiler that fully supports C99 is Sun Studio from Sun Microsystems. Now, that's hardly a wide accepted standard is it? Arguably most modern compilers DO implement parts of the C99 standard, I should probably have mentioned that to avoid stupid comments like yours! What's java or c to do with this btw?



0コメント

  • 1000 / 1000