Home > Back-end >  Don't understand what this behavior can be selectively line
Don't understand what this behavior can be selectively line

Time:09-20

This is a for statement i++, why every time I when can do print array mod10 line more than 9, is the number 10 line feed
Here "\ n" [Boolean value] and "\ n" Boolean value [] the second a space, effect, on the other hand, this effect: what is the logic and principle of
Is there who can teach me what is this principle, I'm new

CodePudding user response:

Oh I went to, I understand,,

CodePudding user response:

Understand what "\ n" is a type, you know

CodePudding user response:

Equivalent to print characters from the following characters, Boolean is true is to print the first character, are false, print the second character
Char [] s={' \ n ', '\ 0'}//a newline, the string end (equivalent to an empty string)

CodePudding user response:

 # include 
#include
using namespace std;
Int main ()
{
Cout & lt; <"Hello," [true] Cout & lt; <"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --" & lt; Cout & lt; <"Hello," [true] Cout & lt; <"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --" & lt; Cout & lt; <"Hello" (false);
return 0;
}

CodePudding user response:

reference qybao reply: 3/f
equivalent to print characters from the following characters, Boolean is true is to print the first character, are false, print the second character
Char [] s={' \ n ', '\ 0'}//a newline, the string end (equivalent to an empty string)

Not ah, there's a space that front, then true is 1, false is 0, array starting from 0, so true is a newline, equivalent to take out the second item from the array of strings
  • Related