the-c-programming-language-2nd-edition-solutions
the-c-programming-language-2nd-edition-solutions copied to clipboard
Solutions to the exercises in the book "The C Programming Language" (2nd edition) by Brian W. Kernighan and Dennis M. Ritchie. This book is also referred to as K&R.
Fix unprivelaged variable getting that prints bizarre values of variables that haven't been yet assigned. Previously, if you typed 'b' or another variable and pressed enter, it would output some...
Changed the command letters to capital-case to prevent overlapping with VARGET
Removed the else-block of "if (c == '-')" and restructured the clear command so the "stack is empty" message is not displayed an extra time after the c command has...
The else part in "if (c == '-')" for some reason caused a calculation like "33 44 +" to evaluate to 7. After removing that else part, the output gives...
The exercise asked to write a loop equivalent to the for loop that we used in getline() before in Chapter 1 without using && or ||.   The error...
Tested with sample input by defining an EXIT CHAR in terminal. Would love to get feedback on C code. Let me know if there are non optimal practices used, or...
follows the bit manipulation style (p as MSB of the field) as demonstrated in K&R, particularly aligning with the getbits example (p+1-n). So bits to be set are the least...