View Single Post
  #2 (permalink)  
Old January 1st, 2008, 06:17 PM
SolarEnergy SolarEnergy is offline
Authorized User
 
Join Date: Dec 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

My first reaction would be to recommend building a function that would accept this a pointer to this array, and a pointer to the string input as arguments, something like that.

By using cin.getline instead of cin, you can specify which string array you want to use.

These arguments don't have to be pointers, but I think it's a good habit to avoid passing an array as an argument (the data), to lower the cost on stack memory usage.

But I'm just a newbie in C++ though, so take my recommendation for what it's worth ;)

Best regards,
Charles
Reply With Quote