RSS Forums RSS
Please support our C++ advertiser: Programming Forums
Views: 1036 | Replies: 10
Join Date: Jul 2007
Posts: 6
Reputation: rainbow78 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
rainbow78 rainbow78 is offline Offline
Newbie Poster

array/funtion problem, please help

  #1  
Jul 30th, 2007
here what I got and I keep getting a error because of the "string names[];"

these were my guide lines and I'm getting confused

//declare an array of datatype string
//call it names[]

//declare a function dataEntry that takes a string array as input

void dataEntry(string arr[]);

//implement the function: let the user enter names

//declare a function print that takes a string array as input

void print(string arr[]);

//implement the function; use a for loop to print arr[]

//call your function in main() tp print the array

print(names);


thanks for helping me out

  1.  
  2. #include <iostream>
  3. #include <string>
  4.  
  5. using namespace std;
  6. void dataEntry(string arr[]);
  7. void print(string arr[]);
  8. string x;
  9. int main()
  10. {
  11. string names[];
  12. for
  13. {
  14. arr[];
  15. }
  16. int blank;
  17. cin >>blank;
  18. return 0;
  19. }
  20. void dataEntry(string arr[])
  21. {
  22. cout<< "Please enter a name"
  23. cin>>;
  24.  
  25. }
  26. void print(string arr[])
  27. {
  28.  
  29. }
Last edited by Ancient Dragon : Jul 30th, 2007 at 10:25 pm. Reason: add line numbers to code tags
AddThis Social Bookmark Button
Reply With Quote  

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 6:59 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