cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
How do I initialize a string name for th
How do I initialize a string name for the description of an array?
Sep 1, 2014 at 12:50pm UTC
Leon12020738
(7)
It says that Infantry and Bazooka and everything is not declared in the scope, I made it global variables. I know im missing something small, please tell me what it is??
string TroopsName[5]={Infantry,Bazooka,Tank,Sniper,Harvester};
Sep 1, 2014 at 12:57pm UTC
Chervil
(7320)
Use quotes for literal text.
"Infantry"
etc.
(also global variables are usually best avoided).
Topic archived. No new replies allowed.