| General > General Technical Chat |
| How many people code in C these days, and if so, why? |
| << < (47/99) > >> |
| nctnico:
--- Quote from: IanB on May 10, 2020, 09:31:32 am --- --- Quote from: bd139 on May 10, 2020, 09:24:17 am ---Have to side with Cerebus here. The argument was void (excuse the pun). --- End quote --- I showed in post #204 that the example program is perfectly valid C that compiles and runs without warning, entirely in contradiction to what Cerebus said. It received no response whatsoever. Apparently facts are unpalatable when they are contrary to people's emotional beliefs. --- End quote --- There was a clear error in the code though: boolean isn't a C type but bool is (since C99). It is possible that an older (?) compiler comes with headers which define boolean as a type but AFAIK that isn't the common standard. https://en.wikibooks.org/wiki/C_Programming/stdbool.h It also seems the storage size of bool varies between compilers. |
| engrguy42:
I'm right, you're WRONG !! No, I'M right, YOU'RE wrong !!! I'm smarter than you. No I'M smarter than YOU!! I know how to Google stuff real fast. I'm much smarter than you. You're an idiot because you spelled it wrong. No, I'm RIGHT. It depends on what the definition of "is" is. Hold on, I need to "thank" everyone who's agreeing with me. I like C, so anyone who disagrees is a poo-poo head. Lalalalalala....I'm ignoring you.... :-DD |
| coppice:
--- Quote from: nctnico on May 10, 2020, 10:45:57 am ---It also seems the storage size of bool varies between compilers. --- End quote --- I've always found that weird. The generated code rarely seems to improve through the use of a bool where sizeof(bool) is bigger than 1. |
| Nominal Animal:
typedef enum { true, false, FILE_NOT_FOUND } boolean; :phew: |
| chriva:
A C junkie here :) While I do code in other languages too, there's something with C (and C++) I just love. Very little abstraction. You can do wild (and equally as dangerous) stuff like derefing a pointer as a function and jump to it, jump to yourself, use goto (I don't care what you say, they're perfect for very specific tasks), _MACROS_, function attributes, etc etc :) About bool: It's also very much processor dependant. Some have true/false flags in hardware. Some have particular instructions that takes less size but only affect a portion of the used hardware register etc. 68k and several other processors has instructions like ST/Set true, clr where only a byte of the register is set and the opcode is particularly small compared to move and whatnot. :) |
| Navigation |
| Message Index |
| Next page |
| Previous page |