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.

Why does "The C Programming Language" book say I must cast malloc?

Today I reached page 167 of The C Programming Language (second edition Brian W. Kernighan & Dennis M. Ritchie) and found …

c casting malloc kernighan-and-ritchie
How to not invoke warning: type specifier missing?

I am reading "The C programming Language" by Brian W. Kernighan and Dennis M. Ritchie. In chapter 1.2 "Variables and Arithmetic …

c compiler-warnings kernighan-and-ritchie
What is the purpose of ungetc (or ungetch from K&R)?

Can anyone explain to me the purpose of ungetch? This is from K&R chapter 4 where you create a …

c kernighan-and-ritchie kr-c
'\0' evaluates false, "\0" evaluates true

Inspired by a program described in K&R section 5.5: void strcpy(char *s, char *t) { while(*s++ = *t++); } C …

c arrays string null kernighan-and-ritchie
How to determine the ranges of floating-point types using direct computation?

I'm trying to solve exercise 2-1 from "The C Programming Language", 2nd edition, which asks to: "Write a program to …

c kernighan-and-ritchie
Where does `getchar()` store the user input?

I've started reading "The C Programming Language" (K&R) and I have a doubt about the getchar() function. For …

c loops io kernighan-and-ritchie