Visual C ++ Class Name Reserved

I want to create in my class the project “Screen”, “Graphics”, “Font” and “Environment”, but when I type these names and press “Enter”, I get the message: “Screen” is the reserved class name or “Environment” "" is the reserved class name. I do not want to do CScreen or ScreenC or something like that: / I have Visual Stuido 2010. Is there a way to fix this?

+5
source share
6 answers

I think using a namespace is the answer.

+9
source

Visual Studio. , , Microsoft VS 2010, , Microsoft . , , Microsoft, ++, , . , , . , "" ++ ( MFC, ATL ..).

" " . , , , , , , Screen, Graphics, Font .. , , , . , - , . , 15 , .

+4

, Visual Studio, .

" → ..." -

  • " :" (, "_" "" ).
  • ".h file:" ".cpp file:" , Screen.h Screen.cpp
  • "", ( , Screen _)
  • , "_" ""
+2

" enter"? ? h cpp . ++, . , .

+1

#include , , , .

, , , , , , .

0
source

I find a solution: I can separately add Graphics.cpp and Graphics.h, Environment.cpp, etc.: / But I still don’t know why I can’t use the “add class”: /

0
source

All Articles