Learning steps

Hi all, im trying to study c++(my first language) from the book "C++ Primer" ,i started it well, the problem is that i've already read about 400 pages and now i find arguments very hard to learn and understand, i dont know if i should go back for consolidate or i should learn from another book.
What do you suggest ?
I read the same book(C++ Primer 5th ed) to learn c++ which was my first language as well. Though I remember I did get stuck so it's alright. I went back around 1-2 chapters and continued again. Just remember you aren't going to get better just by reading, you have to have your own little projects on the side to apply what you are learning.

Just remember not to rush as well. The book goes into a lot of detail and it can become confusing. I would say I have read most of the book twice, and let me tell you after the 2nd time reading a lot becomes clear.

You said you are on page 400 which functions are described in, I would say to read it again or skim over some of it for now and come later for it. Such as std::bind and lambdas which will be described later on in the book. Also come onto these forums and ask us what you are finding hard, make sure to explain it in detail so we know what exactly you are talking about and how we can assist you. So if you want and can please explain what you are finding hard.

Arguments initialize function parameters.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>
#include <vector>
// returns an int value
// has two paremeters and must be passed 2 arguments
int func(int i, std::vector<int> vi) 
{
	return i; // return i
}

int main()
{
	// func is passed 2 arguments, an int value and a brace list of ints
	// prints 15 because func returns its first parementer
	std::cout << func(15, {15, 25, 68}) << std::endl;
	return 0;
}


I probably didn't help you much and if so, could you provide us with extra info on what you are finding hard.
Last edited on
Topic archived. No new replies allowed.