I am currently working on a RPG for the win32 console. I am using a structure to hold information on a player. I was wondering if I could define a structure and declare that structure type right below it in the global declaration area (the area above main()) so that any function I use can modify the struct variable? In my RPG I want to have functions for shops and upgrading, and whenever they upgrade or buy/equip and item I want those functions to be able to modify the struct variable. I was thinking something like this:
I think if that would work it would be the most efficient, and more cipherable, if debuging, method. If anyone knows if this would work, or if you have a suggestion for a better way to store player stats please share!
#include <iostream> /* included to show that this is above main()*/
#include <string> /* included to show that this is above main() */
cout<<"Choose an option:"<<endl;
case "n": newgame()
cout<<"Please enter your character's name:"