Signal EOF in mac osx terminal

By default, macOS (formerly OS X and Mac OS X) software recognizes EOF when Control-D is pressed at the beginning of a line. (I believe this behavior is similar for other versions of Unix as well.) In detail, the actual operation is that, when Control-D is pressed, all bytes in the terminal’s input buffer are … Read more

Alternative (K&R) C syntax for function declaration versus prototypes

The question you are asking is really two questions, not one. Most replies so far tried to cover the entire thing with a generic blanket “this is K&R style” answer, while in fact only a small part of it has anything to do with what is known as K&R style (unless you see the entire … Read more

What are the applications of the ## preprocessor operator and gotchas to consider?

One thing to be aware of when you’re using the token-paste (‘##‘) or stringizing (‘#‘) preprocessing operators is that you have to use an extra level of indirection for them to work properly in all cases. If you don’t do this and the items passed to the token-pasting operator are macros themselves, you’ll get results … Read more

tech