Im seriously new to C++ and any programming language. I do software design as a subject at school. I have an assignment where I have to write a tic tac toe game in C++. I didnt want to copy anyone elses game and I tried to start from scratch with the teachers help. However I've derived a code, I know my syntax is abit out of wack and it may not be the most logical code, but that is why I need help. Also getting the variables right. The compiler we have to use is codeblocks. Although from this I have recieved the errors I recieved were:
line: 17 error: expected ',' or ';' before '=' token
line: 20 error: two or more data types in decleration of 'Grid'
line: 34 error: expected initializer before 'int'
line: 39 error: expected ',' or ';' before 'bool'
The deadline is really soon, so im really eager to finish this this. Your help would be awesome!. Thanks alot, Maryann.
Sorry to say that, but this has not much to do with C/C++.
- each line needs to end with a semicolon
- each function needs parenthesis
- comparison is always == // Note: two =
- assignment is always = // Note: one =
- code cannot exists outside a function (be carefull with the curly brace)
- if requires parenthesis
- arrays always start with 0. You define them with the number of fields, i.e.
int move ;
0 is the first index to access a field of an array and according to the example above 8 is the very last
So what's your intention when it comes to line 15 and 16?