Learning more of C++

Right, I think I am putting this in the right place, if not I am sorry.

I'm looking to learn more of C++, however I am struggling turning the information I know into a game. I do have the C++ For Dummies book

The most complex thing I have made is this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include "stdafx.h"
#include "Windows.h"
#include <iostream>
#include <string>
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{

	string symbol;
	double number1;
	double number2;
	double answer;

	cout << "What type of sum would you like to do? \n";
	cout << "Please type the symbol for the sum you would like to complete \n";
	cin >> symbol;

	if (symbol == "+")
			cout << "You have chosen Addition" << endl;
		else if(symbol == "-")
			cout << "You have chosen Subtraction" << endl;
		else if(symbol == "/")
			cout << "You have chosen Division" << endl;
		else if (symbol == "*")
			cout << "You have chosen Multiplication" << endl;
		else
		{
			cout << "You have not followed my instructions, the program will now exit!" << endl;
			Sleep(5000);
			return 0;
		}


	cout << "Please type your 1st number" << endl;
	cin >> number1;
	cout << "Please type your 2nd number" << endl << endl;
	cin  >> number2;

	if (symbol == "+")
			answer = number1 + number2;
		else if(symbol == "-")
			answer = number1 - number2;
		else if(symbol == "/")
			answer = number1 / number2;
		else if (symbol == "*")
			answer = number1 * number2;

	if (symbol == "/" && number2 == 0)
	{
			cout << "This is the only formula that is not yet supported, sorry about that! \nThe program will now exit!";
			Sleep(5000);
			return 0;
	}

	cout << "Your sum is:" << endl;
	cout << number1 << " " << symbol << " " << number2 << " = " << answer << endl << endl << endl;

	cout << "Thank you for using Advanced Calculator, made by DylanM!" << endl;

	system ("pause");
	return 0;
}


I know it is not much, but is there a free website i could check out for more tutorials or information? Because it gets hard to concentrate on a plain old book.

Thanks in advance!
Last edited on
Study up on classes and arrays next, these are both essential concepts for a program of any significant size in C++. Here is the tutorial for this site, it's a bit dated but that's being worked on: http://www.cplusplus.com/doc/tutorial/

After you have those down you could probably pick up a library and "fill in the blanks" as you go along. As always I recommend SFML: http://www.sfml-dev.org/
Okay thanks ill have a read of the classes chapter of the tutorials, and the arrays tutorial.

What do u mean by "fill in the blanks?"
There are some things that you will see that are commonly used, things like certain functions and dynamic containers. Instead of studying them directly and slowing yourself down you could learn them as they come up.
OK thanks for you help Computergeek01, I think i will progress faster with the tutorials on the link.

Topic Solved!
Topic archived. No new replies allowed.