$ g++ -g -Wall -o main main.cpp
main.cpp:15:18: error: empty character constant
15 | cout<<"v1="<<V1<<''\tv2=''<<V2;
| ^~
main.cpp:15:20: error: stray ‘\’ in program
15 | cout<<"v1="<<V1<<''\tv2=''<<V2;
| ^
main.cpp:15:25: error: empty character constant
15 | cout<<"v1="<<V1<<''\tv2=''<<V2;
| ^~
main.cpp:41:7: error: extended character “ is not valid in an identifier
41 | cout<<▒▒▒初始化时的随机值:”<<endl;
| ^
main.cpp:41:7: error: extended character ” is not valid in an identifier
main.cpp:47:7: error: extended character “ is not valid in an identifier
47 | cout<<▒▒▒修改基类中的值后:”<<endl;
| ^
main.cpp:47:7: error: extended character ” is not valid in an identifier
main.cpp:55:7: error: extended character “ is not valid in an identifier
55 | cout<<▒▒▒从派生类修改从基类继承的值及本类的值:”<<endl;
| ^
main.cpp:55:7: error: extended character ” is not valid in an identifier
main.cpp:11:6: error: variable or field ‘print’ declared void
11 | void print Value();
| ^~~~~
main.cpp:11:6: error: expected ‘;’ at end of member declaration
11 | void print Value();
| ^~~~~
| ;
main.cpp: In member function ‘void BaseClass::SetValue(int, int)’:
main.cpp:9:1: error: ‘v2’ was not declared in this scope; did you mean ‘V2’?
9 | v2=n;
| ^~
| V2
main.cpp: At global scope:
main.cpp:13:15: error: expected initializer before ‘:’ token
13 | void BaseClass:public BaseClass
| ^
main.cpp:20:27: error: ‘in’ has not been declared
20 | void SetValue(int m,int n,in k)
| ^~
main.cpp: In member function ‘void DerivedClass::PrintValue()’:
main.cpp:30:12: error: ‘print’ is not a member of ‘BaseClass’
30 | BaseClass::print Value();
| ^~~~~
main.cpp: At global scope:
main.cpp:37:11: error: expected primary-expression before ‘baseCla’
37 | BaseClass baseCla;
| ^~~~~~~
main.cpp:37:11: error: expected ‘}’ before ‘baseCla’
main.cpp:35:1: note: to match this ‘{’
35 | {
| ^
main.cpp:41:1: error: ‘cout’ does not name a type
41 | cout<<“初始化时的随机值:”<<endl;
| ^~~~
main.cpp:43:1: error: ‘baseCla’ does not name a type; did you mean ‘BaseClass’?
43 | baseCla.PrintValue();
| ^~~~~~~
| BaseClass
main.cpp:45:1: error: ‘derivedCla’ does not name a type
45 | derivedCla.PrintValue();
| ^~~~~~~~~~
main.cpp:47:1: error: ‘cout’ does not name a type
47 | cout<<“修改基类中的值后:”<<endl;
| ^~~~
main.cpp:49:1: error: ‘baseCla’ does not name a type; did you mean ‘BaseClass’?
49 | baseCla.SetValue(10,20);
| ^~~~~~~
| BaseClass
main.cpp:51:1: error: ‘baseCla’ does not name a type; did you mean ‘BaseClass’?
51 | baseCla.PrintValue();
| ^~~~~~~
| BaseClass
main.cpp:53:1: error: ‘derivedCla’ does not name a type
53 | derivedCla.PrintValue();
| ^~~~~~~~~~
main.cpp:55:1: error: ‘cout’ does not name a type
55 | cout<<“从派生类修改从基类继承的值及本类的值:”<<endl;
| ^~~~
main.cpp:57:1: error: ‘derivedCla’ does not name a type
57 | derivedCla.SetValue(100,200,300);
| ^~~~~~~~~~
main.cpp:59:1: error: ‘baseCla’ does not name a type; did you mean ‘BaseClass’?
59 | baseCla.PrintValue();
| ^~~~~~~
| BaseClass
main.cpp:61:1: error: ‘derivedCla’ does not name a type
61 | derivedCla.PrintValue();
| ^~~~~~~~~~
main.cpp:63:1: error: expected unqualified-id before ‘return’
63 | return 0;
| ^~~~~~
main.cpp:64:1: error: expected declaration before ‘}’ token
64 | }
| ^
$
|