Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
C0D44206374dWorks in JS
Works in php
Probably works in a lot of langauges as EOL isn't bound by logical operators
Konsole356174d@rEaL-jOkEr Ah.. new account I see
AlgoRythm4131274dYes, this will probably run in most languages. It's the same thing as
A very common way of clearing a buffer is to do
When the buffer is empty, it will return null, and the loop will end.
This is allowed because it (like most other control structures) looks for a single block of code after it's declared. That's why you can omit brackets when you only need a single statement after an if.
The brackets act as a single statement: a scope statement. You increase the depth of the scope and put code in it.
A blank statement is still a statement. So just ending the line with a semicolon should be allowed by most control structures in most languages
morphisdead474dIt will work.
Konsole356174dThis is not threat. You are basically telling the compiler, if you don't execute that 'if', there is nothing else I can do.
That's more like pleading
MrCush14273d@AlgoRythm I don’t know why I never understood why the input buffer would clear when throwing it in an if statement before. I always had the issue of clearing it until I read online that you could do that.
If(std::cin >> input)
Thanks for pointing out the obvious.....it was fucking scope all along lmao. Why didn’t I think of that? *smacks forehead*
It looks like quite a good code signature to use
Your Job Suck?
Take a quick quiz from Triplebyte to skip the job search hassles and jump to final interviews at hot tech firms
Get a Better Job