I had found a strange output when I write the following lines in very simple way:
Code:
printf("LOL??!\n");
printf("LOL!!?\n");
Output:
It happens even the code is compiled under both MBCS and UNICODE.
The output varies on the sequence of "?" and "!"...
Any idea?
Print on same line with some sign between elementsThe end=”,” is used to print in the same line with a comma after each element. We can use some other sign such as '. ' or ';' inside the end parameter.
The output will be the string literal, without the quotes. If you have a set string or phrase you want to print, you can store it in a variable and pass the variable name as the argument to print() .
print just shows the human user a string representing what is going on inside the computer. The computer cannot make use of that printing. return is how a function gives back a value. This value is often unseen by the human user, but it can be used by the computer in further functions.
??!
is a trigraph that gets replaced by |
.
As a rule, you should never place two question mark characters together anywhere in a source file.
You may try
printf( "What?\?!\n" );
In computer programming, digraphs and trigraphs are sequences of two and three characters respectively which are interpreted as one character by the programming language.
Some compilers support an option to turn recognition of trigraphs off, or disable trigraphs by default and require an option to turn them on. Some can issue warnings when they encounter trigraphs in source files. Borland supplied a separate program, the trigraph preprocessor, to be used only when trigraph processing is desired.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With