View Single Post
Old Mar 25th, 2008, 10:07 PM   #2
OpenLoop
Expert Programmer
 
OpenLoop's Avatar
 
Join Date: May 2005
Location: East Lansing, MI
Posts: 647
Rep Power: 4 OpenLoop is on a distinguished road
Re: I kind of need help on my program

What do you mean with "name his/her own structs"? Are you saying you want the users to name the actual object of the struct??? Users shouldn't even know that you're using a struct, all they care about is that you save their information. You can declare an array of struct objects (100 for example) and then use them as needed. Or if you want to get fancy, look into Vector (dynamic) arrays.

On a side note, why not use the string class instead of all the char[] arrays:
c++ Syntax (Toggle Plain Text)
  1. #include <string>
  2.  
  3. ...
  4. string username;
  5. cin>>username;
  6. cout>>username;
  7. ...
OpenLoop is offline   Reply With Quote