Page 3 of 3

Re: Learning C++

Posted: Mon Mar 28, 2022 8:26 pm
by folderol
The first line tells you to include in a library file called iostream along with your code.
The second line is a sort of shortcut so that you and use a slightly abbreviated form.
Without it you would have to enter:
std::cout

the std bit refers to the standard library.

Re: Learning C++

Posted: Mon Mar 28, 2022 9:03 pm
by Gps
Thank you :)

Re: Learning C++

Posted: Tue Mar 29, 2022 2:50 pm
by Gps
Found something:

https://www.cplusplus.com/doc/tutorial/ ... structure/

:)

So basically a C++ program starts with:

Code: Select all

#include <iostream>
using namespace std;

int main ()
Bookmarked that page.

Next will probably be me watching that C++ course again, but this time me typing along in Kdevelop.

Re: Learning C++

Posted: Sun Apr 17, 2022 5:22 pm
by Gps
Stupid question time. :P

I have been looking at the lmms code, but cant figure out how its all tied together.

Does cmake do this or am I missing something?

I suspect this is why C++ is called modular, but cant find out how those modules are combined. :?

Coming from basic, I was expecting one big file of all code, but this does not seem to be the case for C++ ?

Re: Learning C++

Posted: Sun Apr 17, 2022 6:10 pm
by Michael Willis
Gps wrote: Sun Apr 17, 2022 5:22 pm Coming from basic, I was expecting one big file of all code, but this does not seem to be the case for C++ ?
Yes, some kind of build utility is responsible for multi-file projects, which are very common as project size grows. In this case, cmake is the build utility, but be aware that other projects may use other build tools.

Re: Learning C++

Posted: Sun Apr 17, 2022 7:04 pm
by Gps
Thank you. :)

Re: Learning C++

Posted: Mon Apr 18, 2022 6:41 pm
by rghvdberg
Hardest thing with c++ , when you start totally from scratch, is building the god damned project. With libraries and linking.
And you can use build systems like Makefile, CMake, Meson or just do it on the command line .. sigh

anyway
I learned (a bit) of c++ by following the New Boston c++ playlist
https://www.youtube.com/watch?v=tvC1WCd ... 8440AA6B83
now this is a decade old, so maybe there are more up to date tutorials

an important and for me pretty hard to grab concept was/is pointers
imho the best explanation of all time is by mycodeschool, a legend ..
https://www.youtube.com/playlist?list=P ... 7pgGsasm2_

of course I read/browsed several books but I learned the most from
coding,
getting stuck,
getting mad,
search,
and the most important : ask for help

I learned a lot from the people in #lad on irc, the lmms discord is quite helpful too

I was a youngster when I learned to code in c++, the young age of 47 ;-)

Re: Learning C++

Posted: Mon Apr 18, 2022 8:05 pm
by Gps
Thank you, at least the getting mad part sounds very familiar. :lol:

That feeling I want to fine tune my pc with an axe.

I will study those links. :)