I have a stupid question, but I can't figure it out. How do you type the "double pipes" for the OR statement? I don't see it anywhere on my keyboard.
Copied from an example online:
if (x > 0 || y > 0) { // if either x or y is greater than zero
// statements
}
Do I have to do a copy and paste every time I want to use it?
Can you type a single pipe?
On a Windows PC it is usually bottom/left along with the '' character
If you are using a Mac then I don't know
The double pipe is two single pipe characters.
Shift+\ on qwerty (above or next to the enter key).
AltGr+1 on azerty (the 1 key above the A key, not the one on the numpad).
Pieter
You can also use the letter 'o' followed by the letter 'r':
if (x > 0 or y > 0) {
oqibidipo:
You can also use the letter 'o' followed by the letter 'r':
if (x > 0 or y > 0) {
Aww man - they are dumbing down C++ so that just anyone can use it?
Pipe character is above the backslash. If you are using a MAC, condolences, it may be in the same general area.