| | |
error in script
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Aug 2008
Posts: 4
Reputation:
Solved Threads: 0
I made a script and it keeps saying error C2144 and fatal error C1004
please help me
C++ Syntax (Toggle Plain Text)
#include <iostream> using namespace std ;char name[20]; int helps void checkOutVillage (void); int main(void); { std::cout <<"Please Enter Your Name!" <<std::end1; cin >> name; std::cout << "You Are On A Great Quest" << name std::end1; std::cout << "There Is A Small Village In Trouble. Should We Help Them?" <<std::end1; std::cout<< "(enter for yes and 2 for no)" << std::end1; cin >> help; if help == 1 { checkOutVillage(); } else { std::cout << "You Suck!" <<name << "You Are No Fun At All!!" << std::end1; system("pause"); }return 0; } void checkOutVillage(void) { int goblinAnswer; std::cout << "well we go check out the village!!" <<std::end1; std::cout << "There are crazy goblins attacking" <<std::end1; std::cout << "You should Help!" <<std::end1; std::cout << "(enter 1 for yes and 2 for no) " <<std::end1; cin >> goblinAnswer; if goblinAnswer ==1) { std::cout <<"We go kill all the goblins and they die...we win...WE ROCK!!!" << std::end1; system("pause"); } else { std::cout << "You Suck!!! The Goblins killed everyone and now they are coming for us!!! way to go..." <<std::end1; system("pause") } }
Sorry to tell you, but there are *a lot* of thing wrong with your code.
I'll give a few examples:
etc etc.
Check your program one line at time for syntax-errors. Most of them are pretty easy to spot/
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 semicolonetc 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.
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
4. Insert << in output statements (some occurences).
5. if header syntax:
6. Declare undeclared variables.
Ooh! It's not all...
Do it yourself then come back...
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...
![]() |
Similar Threads
- Active desktop recovery/Script error (Windows NT / 2000 / XP)
- Error in script (Shell Scripting)
- javascript - object required error (JavaScript / DHTML / AJAX)
- php undefined offset error (PHP)
- error 406 will pay to fix (Software Development Job Offers)
- help with shell script padding files with spaces (Shell Scripting)
- a weird Javascript error (JavaScript / DHTML / AJAX)
- "error has occured in script on this page" (Windows NT / 2000 / XP)
Other Threads in the C++ Forum
- Previous Thread: Procedural animation
- Next Thread: MouseMove in Visual C++
| Thread Tools | Search this Thread |
api array arrays beginner binary bitmap c++ c/c++ calculator char class classes code compile compiler console conversion convert count data database delete desktop developer directshow dll download dynamic encryption error file forms fstream function functions game generator getline givemetehcodez google graph gui homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux loop looping loops map math matrix memory multiple news node number output parameter pointer problem program programming project proxy python random read recursion recursive return string strings struct temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






