RSS Forums RSS
Please support our C++ advertiser: Programming Forums

array/funtion problem, please help

Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 11,666
Reputation: Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of 
Rep Power: 40
Solved Threads: 990
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: array/funtion problem, please help

  #2  
Jul 30th, 2007
line 11: when declaring the array you have to tell it how many items the array will contain. For example, if you want the array to contain not more than 10 names then declare it like this:
string names[10];

Declaring dynamic arrays is also possible, but apparently your class is not yet at that level, so I'll just ignore that possiblility for now.

lines 12 thru 15: not needed in function main(). The instructions you posted say nothing about doing that. You do need to add a loop in function print() to display each of the names.

Suggestion: don't attempt to do all the instructions at one time. Instead, code and test them one instruction at a time so that you don't get so confused.
Last edited by Ancient Dragon : Jul 30th, 2007 at 10:31 pm.
<<Freelance Programmer>> << Hobby Site>>
Signature links for sale. PM me for details
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 7:02 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC