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

Automatic version identification

SpineViewer

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

What is the program?

What is the Program?
For those who are new to the program, here is a
I would like to give an overview of the program.

A program is the most basic way to run a computer.
In a program, commonly referred to as a programming language, the
The computer is operated using a language for computers.

Without going to the trouble of explaining it here, most people will understand that programming languages are
We all know that it is a language for computers.
But still, it's not easy to understand the program because
This is because programming languages differ from natural languages in many ways.
The natural languages we humans use are called natural languages.

In other words, understanding the difference between programming languages and natural languages is the key to
This is the first hurdle in understanding programming.
In this chapter, the differences between the two languages are illustrated through specific examples.
Simple Grammar
The first difference is that programming languages have simpler grammars than natural languages.
The grammar of a programming language is simply the order in which words are written.
In this chapter, we will use a hypothetical programming language as our subject matter.
For example, look at the following example

source code
 REFLECT HELLO

This program means to project the word HELLO on the screen.
If we replace this program with a Japanese word, it would look like this.

Source code (Japanese words)
 Eise, hello.

This will mean that the word hello should be projected on the screen.
It is only two words, but this is the grammar of a programming language.

Most parts of speech used in programming languages are verbs and objects.
In the previous program, eise is the verb and hello is the object.
The verb comes first because computers were developed primarily in English-speaking countries.

The following is a translation of the previous program into natural language.

Translated into Japanese
Project the word "Hello" on the screen.

Comparing the two shows the simplicity of the syntax of the programming language.

Language Sentences
Natural Language Project the word "Hello" on the screen.
Programming Language REFLECT HELLO
Programming language (Japanese words) Project: Hello

Those unfamiliar with programming languages may wonder at this simplicity.
However, as mentioned at the beginning of this section, programming languages are computer manipulation languages.
In other words, it is sufficient to express commands to the computer.

By the way, look at the program I just mentioned, even though the programming language says "project.
Some of you may have noticed that nowhere does it say "on the screen.
This is because "Eisei" already includes the meaning of "on the screen.
If it is necessary to express exactly where the image is to be projected, the following is used.

source code
 Project the screen. Hello.

With this writing style, you can change the object to which you move the hello.

source code
 Project it. Printer. Hello.

If you rewrite it like this, it will print to the printer this time.
Clear Meaning
In the previous section, we explained that the syntax of the programming language is very simple, but
That is not the only difference between programming languages and natural languages.

Second, programming languages have clearer meanings than natural languages.
There is absolutely no room for ambiguity; the meaning is strictly and unambiguously defined.

For example, consider the example of writing a triangle.
If we were dealing with humans, it would be enough to just say, "Draw a triangle.
When dealing with computers, the word "triangle" is too abstract.
Clearly, what are the steps and how to draw a triangle?
You must command a clear procedure with no ambiguity at all.

First, you have to order where to start writing.
The position of the point of entry must also be unambiguous.
If you want to specify a perfect location on the earth, you use latitude and longitude, but if you want to specify a perfect location on the earth, you use latitude and longitude.
In this case, a similar method is used, commanding from the upper left corner of the screen by a number of millimeters to the right and a number of millimeters to the bottom.

Once the initial writing position is determined, the next command is how far to draw the line.
If this position is made to form a triangle, then a triangle can be drawn.

The following is an example of how it is represented in the English programming language.

source code
 LINE 50,50 - 250,100
line 250,100 - 120,160
line 120,160 - 50,50

This can be translated into the Japanese programming language as follows.

Source Code
 Line 50,50 to 250,100
Line 250,100 to 120,160
Line 120,160 to 50,50

Furthermore, translated into ordinary Japanese, it looks like this

Source Code
 From the top left corner of the screen, 50 mm to the right and 50 mm to the bottom.
Draw a line 250 mm to the right and 100 mm to the bottom.
Draw a line from 250 mm to the right and 100 mm below the top left corner of the screen to a point 250 mm to the right and 100 mm below the bottom.
Draw a line 120 mm to the right and 160 mm to the bottom.
Draw a line from 120 mm to the right and 160 mm below the top left corner of the screen to a point 160 mm below the top right corner.
Draw a line 50 mm to the right and 50 mm to the bottom.

If you follow this procedure exactly, the following image will be written
Note that 1 mm is considered here as a single point.





It is a characteristic of programming languages to give commands in extremely clear-cut procedures like this.
There is no ambiguity in the procedure, and every action must be ordered in detail.

To give another example, if you want the computer to make you a cup of ramen
It is obviously not enough to simply say, "Make a cup of ramen.
One meter forward, turn 90 degrees to the right, stick your hand out 10 centimeters forward...
and on and on, until they take the ramen out, fill the kettle with water, light it on fire, and pour it in.
The human being must teach them every movement in detail.

Moreover, to a computer, these actions are just that: actions.
To a computer, every individual action is an independent action, not a
We do not recognize that, as a whole, it is the task of making a cup of ramen.
It just keeps moving as it is taught, that's all.
If, in the process of doing so, you happen to splash hot water from the kettle on the
It is just another action, and we do not perceive it as a mistake.

This alone seems very rigorous and unambiguous compared to our human counterparts, but
As a matter of fact, even the procedure described here is a procedure that remains ambiguous.
To begin with, drawing a line is a very ambiguous command.
You know that a computer screen is a collection of dots (called dots).
For each of these dots, you have to command which dot to draw.
If one were to give a perfectly clear command, such as

Source Code
 DOT 50,50
DOT 51,50
DOT 52,50
DOT 53,50
DOT 54,51
DOT 55,51
DOT 56,51
...
...

and the command, "Write a dot," must be repeated endlessly.
Going further, even "write a dot" is an ambiguous command.
If we were to express the command, "Write a dot," as a perfectly clear command, then

Perfectly clear instructions
Of the numbers stored by the OOth device connected to the computer
Set the 32050th number to 0.

This is a ridiculous order to say the least.

Let's consider a display with a width of 640 dots as an example, and use
Calculations show that the 32050th position is 50 from the top left of the screen and 50 from the bottom.
The OOth device is considered to be the display (or more precisely, the video card).
Note that "set to 0" refers to color, with 0 representing black.

Thus, broken down to the extreme, computer operation is

The computer can only do so much.
Memorize one number. (Memory)
Determine if one number is 0. (Judgment)
Add two numbers together. (arithmetic operation)

*Furthermore, there are only four additions here: 0+0, 0+1, 1+0, and 1+1.
This means that there are only three
However, by combining these three, any complex calculation can be performed.

Today, a wide variety of functions have been created by our computer predecessors and
While we don't need to go into this much detail, we do need to consider the
Keep in mind that computers are such exacting machines.
Everything is calculated
He showed a little bit of that form at the end of the last section.
The biggest difference between programming languages and natural languages is their purpose.

Third, programming languages are languages for computation.
In computers, numbers are everything, and there are no concepts other than numbers.

When we drew the triangles in the previous section, we specified everything numerically.
Similarly, everything dealt with in programming languages is numerical, and
After all, a programming language is a computational language.

However, as explained in the previous section, the only calculations a computer can perform are additions.
Of course, the additions can be combined to add, multiply, and divide, but
After all, that is the extent of the calculations that computers can perform.

A computer that can only add, multiply, and divide may seem inferior to a calculator.
Computers have the ability to perform calculations in the order specified by humans.
The language used to specify the order of calculations is a programming language.

Modern computers combine the order of addition, subtraction, multiplication, and division in tremendously complex ways.
Because of the intuitive mouse-operated functionality provided by the
Inevitably, the sense that we are dealing with numerical values is diminished.

However, when learning a programming language, a strong focus on numbers can help
It will be easier to understand the grammar, etc., which at first glance may seem difficult to comprehend.


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

Comment
COMMENT

Open the 💬 comment submission box