Anonymous
Even if you disagree, it's not going to change anytime soon
Sid Sun
I don't think any respectable company would not hire you for not knowing nitty gritty details of a language
Sid Sun
Reading and understanding some legacy code of your project. Job interviews
Why do people look at C/C++ and jump to legacy projects?
Sid Sun
Additionally it's good to know that int array[100]; is not the same as int array[100] = {};
I can see using this, it'd be nice to have some predictable default values
Anonymous
Sid Sun
I'm gonna be writing a program to automate systemd service creation coming weekend in C++, this week I'm rewriting my CD solution (implemented in python to finalize everything) to Go
klimi
Interesting
Sid Sun
Interesting
What part?
桃桃乌龙
Sid Sun
What is CD solution?
Continuous Deployment, it works like this: You develop locally Deploy to your GitHub GitHub sends a message to an API which is configured to run a script which compiles and deploys the latest version of your program
Talula
Or updating it?
Sid Sun
So automatic deployment? But isn’t that bad if you are testing your code?
It is configurable like: You can configure it to use only the deployment branch And You can also make it not automatically deploy but deploy when it gets a request from you to start deployment
Sid Sun
And since I'm making it as a pair of APIs, you can also build a web app, a program, a mobile app which plugs into it and allows you to: See history of deployment See logs What are the changes since last deployment Deploy it etc
Pavel
Why do people look at C/C++ and jump to legacy projects?
Because C++ is pretty old (not as COBOL of course but still not as golang), there are lots of legacy projects already. Maybe they have been rewritten tens of times, but still have a lot of old code in them. There are also still old-school programmers that write code like 20 years ago and don't like these modern std::array and std::vector, so there's a chance to see such code in a new project
Sid Sun
But i think it's become a stereotype, which it should not be
Anonymous
It isnt
Accessing uninitialized memory is not a UB?
#
best book for learning c?
#
k&r?
#
NO!
why?
Ilya
why?
I don't know, just because it's the best book to learn C...
klimi
My eyes
Ilya
why?
K&R is boring and outdated.
akaWolf
I agree
Tokin
What is prata
Anonymous
Tokin
I seldom got lost trying to read K & R
Ilya
What is prata
The book. Stiven Prata C Premier
Tokin
Seems good
Tokin
What about King
Tokin
Modern C programming by King
Ilya
What about King
Kings are bad thing. Democracy is good
Ilya
😃
Tokin
Lol
Tokin
But they end up fighting and it takes a lot of time to get thru
Tokin
Modern C programming by King
C programming: A modern approach
Tokin
By K N King
Ilya
By K N King
Didn't read that
Tokin
I'm about to skim that book by prata
Tokin
It's quite huge
Artöm
isn't a null byte printed?
It looks like nothing, so effectively nothing is printed
Bojan_Krdemn
hi! Can somebody tell how to use lambda in if statements?
Bojan_Krdemn
if (lambda) {}
Artöm
create an array and initialize with 0 int array[100] = {};
Good one, I hate it when people use {0} here
Artöm
Accessing uninitialized memory is not a UB?
Unmentioned array elements are value initialized
Anonymous
It needs calling ...
And what will the value of those "initialised elements" which have not been initialised by the programmer? — — — #include <iostream> int main (){ char der [8] = {'a','s','g'}; std::cout << der [5]; return 0; } — — — I mean 4 and 5th element?
Anonymous
undefined
And what does Unmentioned array elements are value initialized mean? Is undefined related to value initialised?
Anonymous
@Neko_cpp ban
Artöm
undefined
Value init (in this case, zero init)
Anonymous
no, it's 0 as stated per 6.7.9.21 in N1570
Anonymous
@MasterZiv So, the value is 0 (as per him) or again undefined.
Ilya
Value init (in this case, zero init)
EVEN IF this is defined, not for me.
Artöm
Unmentioned means well... not mentioned
Artöm
EVEN IF this is defined, not for me.
Do you oppose C++ standard or what?
Anonymous
Value init (in this case, zero init)
and what about other cases?
Artöm
and what about other cases?
Man read it https://en.cppreference.com/w/cpp/language/value_initialization
Anonymous
Okkk
Anonymous
Ok
Anonymous
— — — struct A { int i; }; int main() { A a = {0}; std::cout << a.i << std::endl; } — — —
Anonymous
What does recursively value-initialized mean in the above case?
Anonymous
Non-union class type include all types except union?