error in script

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Aug 2008
Posts: 4
Reputation: errorman is an unknown quantity at this point 
Solved Threads: 0
errorman errorman is offline Offline
Newbie Poster

error in script

 
0
  #1
Aug 22nd, 2008
I made a script and it keeps saying error C2144 and fatal error C1004
  1. #include <iostream>
  2.  
  3. using namespace std
  4.  
  5. ;char name[20];
  6. int helps
  7. void checkOutVillage (void);
  8.  
  9. int main(void);
  10. {
  11. std::cout <<"Please Enter Your Name!" <<std::end1;
  12. cin >> name;
  13. std::cout << "You Are On A Great Quest" << name std::end1;
  14. std::cout << "There Is A Small Village In Trouble. Should We Help Them?" <<std::end1;
  15. std::cout<< "(enter for yes and 2 for no)" << std::end1;
  16. cin >> help;
  17.  
  18. if help == 1
  19. {
  20. checkOutVillage();
  21. }
  22. else
  23. {
  24. std::cout << "You Suck!" <<name << "You Are No Fun At All!!" << std::end1;
  25. system("pause");
  26. }return 0;
  27. }
  28.  
  29. void checkOutVillage(void)
  30. {
  31. int goblinAnswer;
  32.  
  33. std::cout << "well we go check out the village!!" <<std::end1;
  34. std::cout << "There are crazy goblins attacking" <<std::end1;
  35. std::cout << "You should Help!" <<std::end1;
  36. std::cout << "(enter 1 for yes and 2 for no) " <<std::end1;
  37. cin >> goblinAnswer;
  38.  
  39. if goblinAnswer ==1)
  40. {
  41. std::cout <<"We go kill all the goblins and they die...we win...WE ROCK!!!" << std::end1;
  42. system("pause");
  43.  
  44.  
  45. }
  46. else
  47. {
  48. std::cout << "You Suck!!! The Goblins killed everyone and now they are coming for us!!! way to go..." <<std::end1;
  49. system("pause")
  50. }
  51.  
  52. }
please help me
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 2,879
Reputation: niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute 
Solved Threads: 301
Moderator
Featured Poster
niek_e's Avatar
niek_e niek_e is offline Offline
Cenosillicaphobiac

Re: error in script

 
0
  #2
Aug 22nd, 2008
Sorry to tell you, but there are *a lot* of thing wrong with your code.

I'll give a few examples:

int main(void); What's that semicolon doing there?

<< name std::end1; What the hell is name std::end1;?

if help == 1 you prob mean : if (help ==1)
system("pause") missing semicolon

etc etc.

Check your program one line at time for syntax-errors. Most of them are pretty easy to spot/
Last edited by niek_e; Aug 22nd, 2008 at 12:25 pm.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 2,001
Reputation: ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of 
Solved Threads: 343
ArkM's Avatar
ArkM ArkM is offline Offline
Postaholic

Re: error in script

 
0
  #3
Aug 22nd, 2008
Have you ever seen any C++ syntax description?
There are tons of syntax and semantics errors and wrong names in your source.
1. endl is ENDL, not END-one.
2. Add semicolon after names declaration.
3. Delete semicolon after main header (write int main() without old-fashioned (void) ).
4. Insert << in output statements (some occurences).
5. if header syntax: if (expression) , insert missed parenthesis.
6. Declare undeclared variables.

Ooh! It's not all...
Do it yourself then come back...
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC