Kat
Yo
Anonymous
Please can I get anyone yo teach me c++😕
Kat
google.com
Anonymous
Okay thanks
Kat
Okay thanks
Why is your profile picture a screenshot of an internet cafe PC
Kat
Does anyone else press the Captcha button everytime
Kat
It's so satisfying
Anonymous
It's so satisfying
Are you sarcastic?
Kat
No I genuinely enjoy pushing the Captcha button
Kat
Yay
Anonymous
It's so satisfying
__doPostBack('btnlogin','')
Anonymous
Me logging in to my college erp be like ^
Anonymous
Believer
Hi
olli
Undefined behavior - don't do it! 7.21.5.2 2 If stream points to an output stream or an update stream in which the most recent operation was not input [...] otherwise, the behavior is undefined. N1570
MᏫᎻᎯᎷᎷᎬᎠ
Hi
Hi
Zeus
hello Coders!! is there any easy way to detect keypress in c++ on linux?
Anonymous
keypressevent
BinaryByter
keypressevent
Implemented in std::keypressevent, eh?
BinaryByter
gtk should suffice
BinaryByter
Or ncurses
BinaryByter
alternatively, you will have to do some interrupt trickery
Zeus
Or ncurses
yea i am going with ncurses
BinaryByter
good luck!
Tej
Hii
Amol
Hi
MᏫᎻᎯᎷᎷᎬᎠ
HI
Farhan
/get best-book
Ибраги́м
https://www.youtube.com/watch?v=FR5G_miCHtE
Ankur
Hello Everyone Can anyone send me the code of Printing (1 to 20) or (1 to n) number without using any type of loop in Java ?
S.
use recursion
Ankur
No...not using recursions and ol
S.
?? You just said it couldn't use loops
S.
recursion not included
Ankur
Okay my mistake...now I request also not to use any type of recursions
Ankur
Okay guys
Ankur
I leave 🤘
S.
😂 You'd just ask how to print (1 to n) without using loops or recursions in C/C++
Ankur
Yaa my mistake
Ankur
I didn't took it serious
Ankur
😜😜
Liam
use template in C++.
S.
That's magic
Ankur
use template in C++.
Okay Sir thanks😊
Ankur
That's magic
Well I believe in it 🙃
MᏫᎻᎯᎷᎷᎬᎠ
/warn Off topic. This is a C/C++ group.
Wow I didn't know non-admin can do that
Liam
#include <iostream> template <size_t N> void counting(std::ostream& os) { counting<N - 1>(os); os << N << std::endl; } template <> void counting<1lu>(std::ostream& os) { os << 1lu << std::endl; } int main() { const size_t N = 10; counting<N>(std::cout); return 0; }
Liam
done.
Mihail
Telegram sometimes doesn't show the badge
Ankur
Hey guys I'm not an admin
Ankur
Yaa
Mihail
Hey guys I'm not an admin
He was talking about Liam warning you
Ankur
Okay again my mistake😊
Ankur
Yup but I don't want the 3rd warn
Liam
'cause they are different functions.
S.
Oh... i see
Liam
256 for clang by default and 900 for gcc by default.
S.
OK. Thx for the info
Wolf
😊 pleasure all mine
S.
Seems C doesn't have a define magic counterpart 😆
Liam
If one doesn't want to use template meta-programming here, one could utlize static class member as a counter virable, and increase it in its constructor. In this case, create an array with given length will increase the static member. If you print it out in its constructor...
Liam
Something like this: #include <iostream> struct Counter { static size_t count; Counter() { std::cout << ++count << std::endl; } }; size_t Counter::count = 0; int main() { Counter a[10]; return 0; }
Pro
/notes
Pro
-best-book
Dima
no