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
Independent and ambiguous variables
Independent and ambiguous variables
Apr 19, 2010 at 4:48am UTC
mythbusterma
(11)
Ok so how do i make variables that are not part of any function but can be changed by other functions in the program....im trying to write a text game and i need this so i can have the inventory values per se i wanted the following:
1
2
bool
knife =
"false"
;
bool
key =
"false"
;
to run properly outside of a function
Apr 19, 2010 at 4:51am UTC
Albatross
(4553)
WHY in this insane world are you trying to assign a constant character array to a boolean?
-Albatross
P.S.- Jk.
P.P.S.- Just define them outside of any functions. That's perfectly fine. There's a harder and neater trick using pointers, but I won't get into that.
Last edited on
Apr 19, 2010 at 5:19am UTC
Topic archived. No new replies allowed.