If a person has successfully reached this stage, then he already understands that there are two nested loops. We analyze the external.
for ( ; P("\n"), R--; P("|"))
Here we meet a very simple problem. There is no initializer (a semicolon immediately follows the open parenthesis). Some are confused. This is often the case if a person writes programs in another language, for example, in Pascal.
A real stumbling block, even for sufficiently experienced programmers, meets the expression "P (" \ n "), R--". Many simply do not know that there is such a “comma” operation, and that the result of his work will be the result of the expression after the comma. The expression to the comma is also calculated, but its result is not used. Moreover, this operation has
the lowest priority . Therefore, P ("\ n") is executed first, and then R--.
The result of the expression R-- here is the condition of execution. This also confuses some, although this technique is often used. Many programmers find it unnecessary to write in if statements, if (a! = 0) expressions ... There is a similar case (R--! = 0). It is time to add the declaration of the first variable. The increment says that this is definitely not a real number. Any integer type, even unsigned, will do. This variable must not only be declared, but also initialized with some positive value (preferably small).
Usually, having reached here, it is already clear to everyone that there is a function P that accepts a string as input. There are no problems here. It is necessary to declare this function. Since the meaning is not important to us, it may even be empty. I prefer the function that displays the text on the screen (here it was useful in advance written in #include <stdio.h>). I believe that a programmer of any level should be able to write this function.