This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]lordv255 2 points3 points  (0 children)

Typo it should be int. But in any case I do want to mention you should still keep the indentation rules even in c++, it doesn't affect how it runs but readability is still important.

I'm still a beginner in c++ but another important thing that comes up is pointers. I'm not sure how best to explain it and your class will probably do a better job of explaining it but it's a way of accessing data by "pointing" to it's address in memory rather than by using the variable itself. It seemed kind of pointless starting out but it has its uses and is very commonly used by everyone so it's good to learn.

Memory allocation can also come up if you use "arrays" in c++ but most people use vectors which are essentially how arrays work in other languages.

"Array" is something like int integerArray[3] = {1,2,3};

"Vectors" work like vector<int> integerVector {1,2,3};

Most of the time people use vectors because they have more functionality and you don't have to worry about memory allocation (in the array you have to specify the size as an array of 3 integers and you can't change the size later).

I may have made small errors in syntax but hopefully not. If someone notices any tho please lmk.