Top "Kernighan-and-ritchie" questions

Questions about or related to the book "The C Programming Language" (which is also known as K&R) by Brian Kernighan and Dennis Ritchie.

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

As mentioned in many of my previous questions, I'm working through K&R, and am currently into the preprocessor. …

c c-preprocessor kernighan-and-ritchie stringification
What's the escape sequence for blanks in C?

I'm writing a program to count blanks, tabs, and newlines. I remember what the escape sequence for tabs and newlines …

c escaping whitespace space kernighan-and-ritchie
How to simulate an EOF?

I am currently reading K&R's book and typing in the examples from the first section, and there are …

c eof getchar kernighan-and-ritchie
How can a C compiler be written in C?

This question may stem from a misunderstanding of compilers on my part, but here goes... One can find the following …

c compiler-construction kernighan-and-ritchie
Signal EOF in mac osx terminal

I am stumped by the 1.5.2 question in K&R. I googled for sometime and found out that i have …

c kernighan-and-ritchie
What does char * argv[] means?

I'm new to C programming, I encountered a problem. In case of complicated declarations i found this int *daytab[13]; // daytab …

c arrays pointers kernighan-and-ritchie
What's a good example of register variable usage in C?

I'm reading through K&R and came to the small section on register variables, and was wondering if people …

c cpu-registers kernighan-and-ritchie kr-c
Why do I get a "conflicting types for getline" error when compiling the longest line example in chapter 1 of K&R2?

Here is a program I'm trying to run straight from section 1.9 of "The C Programming Language". #include <stdio.h&…

c linux kernighan-and-ritchie
Alternative (K&R) C syntax for function declaration versus prototypes

What is useful about this C syntax — using 'K&R' style function declarations? int func (p, p2) void* p; …

c function function-declaration kernighan-and-ritchie function-definition
Putchar and Getchar in C

I'm reading K&R's The C Programming Language and have become confused on putchar and getchar. I made a …

c getchar kernighan-and-ritchie putchar