|
-
August 4th, 2012, 08:03 PM
#1
How can I initialize structures AFTER declaration? (begginers question)
I would like to write a program that prompts the user to enter a series of client names which the program will then store in an array of structures. I'm thinking something along the lines of:
struct sInfo
{
vector<string> vName;
float fClientHoldings;
};
sInfo sClientData[100]; //create an array of structures for up to 100 client's
sClientData[0].vName="Acme"; //these will be inputted by the user in my program, but I've attempted to initialize them here for simplification
sClientData[1].vName="Enron";
Everything I've read on the net so far seems to suggest that I can't declare a structure array after I declare it. Is this true? If so, is there an alternate approach that I should be using?
Thanks (sorry for the newb questions).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|