MMGames Introduction to C C Language Development Environment C language now Useful Apps Contact Us

Automatic version identification


It's easy to tell by looking at it.

Response Time Checker

I can leave my computer on and do it.

Mouse cleaning time

I can leave my computer on and do it.

Mouse cleaning time

C language learned by suffering
C language learned by suffering


The Bible in C?
If you are an aspiring C language user, you have probably heard of the book K&R.
K&R is the world's first decent C language manual.
The book was a huge hit in the industry, in part because it was written by the C language developers themselves.
K&R is also considered the computer industry's biggest bestseller.

The book goes into the very fine details of the C language and explains
At that time, there was no such thing as a decent standard for the C language.
A C compiler was even built based on this K&R.

However, the author does not recommend that everyone read K&R.
Or, rather, do not read it.

The first reason is that the explanation is too difficult to understand.
You would have to be quite familiar with the C language to read this book.
To begin with, the book itself does not seem to be designed to be read by beginners.

The second reason is the abuse of pointers in the sample programs.
For example, an example implementation of strcpy (string copy) is

 /* Array version */
void strcpy(char* s, char* t)
    int i;

    i = 0;
    while ((s[i] = t[i]) ! = '\0') i++;

Despite the fact that a clear example (rather than the next sample shown) is presented, the

 /* pointer version */
void strcpy(char* s, char* t)
    while (*s++ = *t++);

And yet, it presents a very confusing example of a

Adapted from Programming Language C, 2nd Edition
While this may seem confusing at first glance, this notation is quite useful and
These idioms should be mastered for the reason that they are often found in C programs.

We see situations where people are encouraged to go out of their way to write in a way that is difficult to understand, such as

The third reason is that programs like the above are convenient and fast, so you should definitely learn them.
The explanation is too outdated.

It was a long time ago that these programs were fast.
Nowadays, with compiler optimizations, loop programs of this magnitude
There is almost no difference in speed unless it is written in a very irregular way.

Results verified by assembler
When I wrote this article for the first time, I was trying to determine if there was any speed difference between the pointer version and the array version.
We checked by implementing and measuring our own benchmark program.

However, to see if they were equivalent at the assembler level, we tested them on the latest VC (VC2005).
The pointer version is about half the amount of code, with only one jump instruction, and
The code was found to be more compact than the array version.

In other words, it appears that even today there is room for speedup with the latter writing style.
However, I think that arrays are fine except in areas where you want to achieve special speedups.
Modern CPUs operate in complex ways, converting, reordering, and anticipating instructions, and
Assembler-level customization is less likely to show up as a speed difference.

K&R was indeed an excellent manual at a time when no other C manuals were available.
When you read K&R, you tend to be poisoned by its content and create tricky programs.
Moreover, the oddly detailed explanations can easily lead to unnecessary misunderstandings.

The author recommends that K&R be read as a simple reference rather than as an instruction manual.
K&R is a thin book, but it still explains the full functionality of the C language, so
Not bad if you want to carry it around as a portable reference.

In addition, by taking advantage of K&R's difficult-to-understand explanations, it can be used to check one's own abilities.
If you can understand K&R, it is safe to say that you have some C language skills.

About this Site

The C language (bitter C), which is learned by suffering, is
This is the definitive C language introductory site.
It systematically explains the basic functions of the C language and
It is as complete as or more complete than any book on the market.

Part 0: Program Overview
  1. What is the program?
Chapter 2: How to write a program
  1. Writing Rules
  2. Writing conventions
  3. Exercise 2
Chapter 3: Display on Screen
  1. String display
  2. newline character
  3. Exercise 3
Chapter 4: Numeric Display and Calculation
  1. Numeric Display
  2. Basic Calculations
  3. Type of value
  4. Exercise 4
Chapter 5: Numerical Memory and Calculation
  1. Memorize values
  2. Variable Type
  3. Type conversion
  4. Numeric justification
  5. Exercise 5
Chapter 6: Input from the keyboard
  1. Functions for input
  2. Fear of Input
  3. Exercise 6
Chapter 9: Repetition with a fixed number of times
  1. Sentences that repeat themselves
  2. Loop Operation Mechanism
  3. Exercise 9
Chapter 10: Unknown number of repetitions
  1. Loop of unknown frequency
  2. input check
  3. Exercise 10
Chapter 13: Handling Multiple Variables at Once
  1. Multiple variables are handled together.
  2. How to use arrays
  3. Exercise 13
Chapter 19: Dynamic Arrays
  1. Create arrays at will
  2. Exercise 19
Chapter 20: Multiple Source Files
  1. Minimal division
  2. The Stone of Partition
  3. Exercise 20


Open the 💬 comment submission box.