Zel
int[1] ={10}
Alex
https://stackoverflow.com/questions/18222926/why-is-list-initialization-using-curly-braces-better-than-the-alternatives
Alex
so probably this is
List initialization does not allow narrowing
Alex
the key issue. however I did not see curly bracket initializer in production code for not array/struct
V01D
Hm, okay. Again wanna say this was shown in C++17, so might be special for C++17
Zel
Does the book explain it or refference an appendix entry?
V01D
https://www.learncpp.com/cpp-tutorial/variable-assignment-and-initialization/
Alex
However, I am not going to write like this. int x = 10; is std and clear way
V01D
Okay, I will use standard way then
Zel
Oh, like how float narrows down to int, ie chops of the decimals.
Merazi
Maybe it's just for debugging purposes? (Idk, I'm a newbie programmer)
Merazi
V01D
Zel
meh I use narrowing for multiple reasons :P
LostInNeonCity
Hi , is it possible to install kali linux without ubuntu??
Alex
yes
Alex
you don`t need ubuntu at all
V01D
V01D
Kali is for professionals though.
Even says on the site.
V01D
Try -std=C++17
LostInNeonCity
Thanks guys , i'm confused cuz i didn't know the first step to start learning about linux .
వ్లాదమిర్ పుతిన్
Merazi
V01D
V01D
Spend a month or two minimum
V01D
Ubuntu is fine
LostInNeonCity
Okey thank u so much guys , i will install it ☺️
V01D
You might break kali alot.
Kali is different from normal debian systems.
Kernel is more modified, many standard things are gone, minimal repo
Merazi
V01D
Yeah, IF.
I know cd and ls blew my mind way back when, lmao
V01D
Linux is just great
V01D
A gift for programmers from the gods.
make, perl, python, ruby, bash, gcc, g++, clang, and more are usual on debian.
And NO INSTALLERS
Merazi
yeah, in a lot of scenarios is easier to setup than windows :P
(You gotta read manuals tho)
V01D
Merazi
V01D
Zel
V01D
Same applies to API and manuals
Merazi
Zel
yeah function templates mean a lot less than function templates cuopled with -examples- :/
Daniele
Daniele
andd wastes so much time
V01D
Anyone know why g++ is so slow?
gcc can compile a hello world faster than g++ can - It takes g++ like 2 seconds!
Can I speed up g++ anyway? Is there a better cross platform C++ compiler?
Daniele
guys
Daniele
what's the shortest sorting algorithm to write in C?
V01D
https://www.educba.com/sorting-in-c/
Kenny
Bernardes
Andrew
also insertion sort is short
V01D
Ahh, okay. Thank you
Bernardes
V01D
👍🏾👍🏾👍🏾
So the code is safer, but is the claim that the code runs faster true?
V01D
And when should I use this type of variable declaration?
When I have some sort of user interaction, perhaps?
Bernardes
Idk if it's faster, but you should use if you think that a conversion might lead to a bad value. Like convert  int to char or something like that
V01D
Thanks
Alex
Alex
check aliases, command line options etc
Bernardes
Alex
because gcc use other compiler than g++(see file extension) or use another options
Alex
https://stackoverflow.com/questions/172587/what-is-the-difference-between-g-and-gcc
V01D
V01D
V01D
I saw, via the -xc++ flag amongst others
V01D
I never knew g++ was so close to gcc.
Thanks for the help.
Anonymous
/ok
da
Hi,everyone.If it returns from the main function, but there are other threads still executing, will the process terminate?
olli
da
Anonymous
Braced initialization doesn't allow narrowing conversions
Anonymous