Relative Content

Tag Archive for c++compiler-errors

Compiler Error C2065 : the identifire is undeclared

#pragma once #include “ClsCourse.h” #include “ClsTeacher.h” #include <vector> using namespace std; class ClsStudent : public ClsPerson { private: double _GPA; vector< ClsTeacher> _teachers; vector<ClsCourse> _Courses; in (line : 10) the compiler tell me that “ClsTeacher” is undeclared identifire . but it is a class so i don’t no where is the error could you help […]

code compiles on other compilers, but returns an error when used in visual studio

This code in C works properly when I use code::blocks or any online compilers, however if I try to use this in VSCODE it returns
“expected type-specifier before ‘;’ token on LN 5, Col 18”
“expected type-specifier before ‘)’ token on LN 13, Col 26”
“expected type-specifier before ‘)’ token on LN 20, COL 21”

SLR PARSING TABLE use this site

01: CODE → VDECL CODE | FDECL CODE | ε
02: VDECL → vtype id semi | vtype ASSIGN semi
03: ASSIGN → id assign RHS
04: RHS → EXPR | literal | character | boolstr
05: EXPR → TERM EXPR’
06: EXPR’ → addsub TERM EXPR’ | ε
07: TERM → FACTOR TERM’
08: TERM’ → multdiv FACTOR TERM’ | ε
09: FACTOR → lparen EXPR rparen | id | num
10: FDECL → vtype id lparen ARG rparen lbrace BLOCK RETURN rbrace
11: ARG → vtype id MOREARGS | ε
12: MOREARGS → comma vtype id MOREARGS | ε
13: BLOCK → STMT BLOCK | ε
14: STMT → VDECL | ASSIGN semi | if lparen COND rparen lbrace BLOCK rbrace ELSE | while lparen COND rparen lbrace BLOCK rbrace
15: COND → boolstr COND’
16: COND’ → comp boolstr COND’ | ε
17: ELSE → else lbrace BLOCK rbrace | ε
18: RETURN → return RHS semi

C Tic Tac Toe not compiling

Enhance the tic-tac-toe game so 2 people can play. To do this, you need to add an“O” that, like the “X”, is drawn in the square. Then prompt the user for a square identifier, and alternate between drawing “X”s and “O”s at those locations on the board. The first move is for “X”. You need to detect and reject when a user plays a square that is already taken. Stop after the board is full (that is, 9 plays). You do not have to worry about who wins.
The “O” is to be 5 × 5, centered in the middle of the square.