Anonymous
Brothers😊😊😊
Anonymous
But u r master..and I'm noob😢😢😢
Dima
Lol
MᏫᎻᎯᎷᎷᎬᎠ
MᏫᎻᎯᎷᎷᎬᎠ
Will kick us out
Dima
Guys let’s make a group especially for newbies
Anonymous
😷😷😷😷
Dima
And help them
Dima
But discuss senior stuff there
Dima
MᏫᎻᎯᎷᎷᎬᎠ
Agree
Anonymous
Masters
Anonymous
Discussions not kids stuff
Anonymous
Hi! If n = 3 ....why does cout<<n%10; return 3?
BinaryByter
Do you know modulo?
Anonymous
Isn't % returning the remainder?
BinaryByter
Yes
Anonymous
🙈 My math sucks so much
BinaryByter
3 / 10 is 0 remainder 3
Anonymous
🙈 omg, I was thinking it's 10/3
Anonymous
Sorry, please excuse me!
BinaryByter
No lol
BinaryByter
no problem :)
Anonymous
https://www.destroyallsoftware.com/talks/wat
Have a laugh if you haven't yet xD
klimi
Welcome
BinaryByter
References kinda act like a reference would in php
BinaryByter
But you are right!
Anonymous
Mihail
Also a bit cleaner and once you see it you immediately know what it does
BinaryByter
BinaryByter
Include guards are known to almost every cpp coder
Luis José
Mihail
#pragma once isn't a bad solution, but it isn't yet standardized
Mihail
Maybe as Maxi said C++20 modules might help
BinaryByter
Mihail
Elnee
Elnee
It doesn't work with gcc for example. Instead of pragma once you can use
ifndef - define - endif
Elnee
If you wanna be sure your .h file is included only once
BinaryByter
Parra
Parra
but other compilers have adopted it
Parra
it works now on gcc too
Elnee
Elnee
my world turned upside down
Elnee
Thx for information
Parra
https://gcc.gnu.org/onlinedocs/cpp/Pragmas.html
Parra
in fact it seems to be standard
Parra
I didn't know that
Parra
openmp relies on pragma for example
Luis José
Parra
Anonymous
/report
Ariana
/ban
Anonymous
Yes
Dima
Welcome
Anonymous
Can you sure that we will get modules in cpp20 but not cpp30 or 40...
BinaryByter
Cpp20 will be like Cpp11
BinaryByter
they should wait for 21 :(
BinaryByter
That way we can say, that C++ becomes good every 10 years, stays good for 7 years and is shitty for 3 years
S.
https://en.wikipedia.org/wiki/Pragma_once#Portability
S.
Most modern compilers support it now
BinaryByter
still, id refrain from pragma once
BinaryByter
for now
S.
David
Is there some reason to not use pragma once for new code?
BinaryByter
Anonymous
old one can 100% prevent it ?
Anonymous
We use it everyday ...
BinaryByter
both can prevent double inclusion
BinaryByter
you just have to know that pragma once might not work on every compiler
BinaryByter
David
also if pragma once is part of the official C++ the problem is the same, old compilers that don't have support for pragma once probably won't have the latest C++ standard
David
lol
BinaryByter