| | |
program problem
Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Jan 2008
Posts: 7
Reputation:
Solved Threads: 0
ok. so i decided to make a very irritating program that fills the computer its run on with junk. here is what i have done yet:
so, i get THESE build errors:
spammer2.cpp: In function `int main()':
spammer2.cpp:5: error: `ofstream' undeclared (first use this function)
spammer2.cpp:5: error: (Each undeclared identifier is reported only once for each function it appears in.)
spammer2.cpp:5: error: expected `;' before "filut1"
spammer2.cpp:6: error: expected `;' before "filut2"
spammer2.cpp:7: error: expected `;' before "filut3"
spammer2.cpp:8: error: expected `;' before "filut4"
spammer2.cpp:9: error: expected `;' before "filut5"
spammer2.cpp:10: error: expected `;' before "filut6"
spammer2.cpp:11: error: expected `;' before "filut7"
spammer2.cpp:12: error: expected `;' before "filut8"
spammer2.cpp:13: error: expected `;' before "filut9"
spammer2.cpp:14: error: expected `;' before "filut10"
spammer2.cpp:15: error: expected `;' before "filut11"
spammer2.cpp:18: error: `cout' undeclared (first use this function)
spammer2.cpp:18: error: `endl' undeclared (first use this function)
spammer2.cpp:20: error: `filut1' undeclared (first use this function)
spammer2.cpp:24: error: `filut2' undeclared (first use this function)
spammer2.cpp:28: error: `filut3' undeclared (first use this function)
spammer2.cpp:32: error: `filut4' undeclared (first use this function)
spammer2.cpp:36: error: `filut5' undeclared (first use this function)
spammer2.cpp:40: error: `filut6' undeclared (first use this function)
spammer2.cpp:44: error: `filut7' undeclared (first use this function)
spammer2.cpp:48: error: `filut8' undeclared (first use this function)
spammer2.cpp:52: error: `filut9' undeclared (first use this function)
spammer2.cpp:56: error: `filut10' undeclared (first use this function)
spammer2.cpp:60: error: `filut11' undeclared (first use this function)
spammer2.cpp:73: error: `cin' undeclared (first use this function)
spammer2.cpp:74: error: expected primary-expression before '=' token
spammer2.cpp:79:2: warning: no newline at end of file
Process terminated with status 1 (0 minutes, 0 seconds)
28 errors, 1 warnings
_______________________________________
what is wrong? and, please tell me what command to use to run another program.
and don't just say "why do you want to do this?"
thanks. out.
C++ Syntax (Toggle Plain Text)
#include <iostream> #include <fstream> int main () { int i; ofstream filut1 ("allisdust1.txt"); ofstream filut2 ("allisdust2.txt"); ofstream filut3 ("allisdust3.txt"); ofstream filut4 ("allisdust4.txt"); ofstream filut5 ("allisdust11.txt"); ofstream filut6 ("allisdust5.txt"); ofstream filut7 ("allisdust6.txt"); ofstream filut8 ("allisdust7.txt"); ofstream filut9 ("allisdust8.txt"); ofstream filut10 ("allisdus9.txt"); ofstream filut11("allisdust10.txt"); start:; int blessing; cout<< "HAIL TZEENTCH AND HIS SERVANT, SIR AVALANCHE!"<< endl; for (i=100;1>0;i--) { filut1<< "HAIL TZEENTCH AND HIS SERVANT, SIR AVALANCHE!"<< endl; } cout<< "HAIL TZEENTCH AND HIS SERVANT, SIR AVALANCHE!"<< endl; for (i=100;1>0;i--) { filut2<< "HAIL TZEENTCH AND HIS SERVANT, SIR AVALANCHE!"<< endl; } cout<< "HAIL TZEENTCH AND HIS SERVANT, SIR AVALANCHE!"<< endl; for (i=100;1>0;i--) { filut3<< "HAIL TZEENTCH AND HIS SERVANT, SIR AVALANCHE!"<< endl; } cout<< "HAIL TZEENTCH AND HIS SERVANT, SIR AVALANCHE!"<< endl; for (i=100;1>0;i--) { filut4<< "HAIL TZEENTCH AND HIS SERVANT, SIR AVALANCHE!"<< endl; } cout<< "HAIL TZEENTCH AND HIS SERVANT, SIR AVALANCHE!"<< endl; for (i=100;1>0;i--) { filut5<< "HAIL TZEENTCH AND HIS SERVANT, SIR AVALANCHE!"<< endl; } cout<< "HAIL TZEENTCH AND HIS SERVANT, SIR AVALANCHE!"<< endl; for (i=100;1>0;i--) { filut6<< "HAIL TZEENTCH AND HIS SERVANT, SIR AVALANCHE!"<< endl; } cout<< "HAIL TZEENTCH AND HIS SERVANT, SIR AVALANCHE!"<< endl; for (i=100;1>0;i--) { filut7<< "HAIL TZEENTCH AND HIS SERVANT, SIR AVALANCHE!"<< endl; } cout<< "HAIL TZEENTCH AND HIS SERVANT, SIR AVALANCHE!"<< endl; for (i=100;1>0;i--) { filut8<< "HAIL TZEENTCH AND HIS SERVANT, SIR AVALANCHE!"<< endl; } cout<< "HAIL TZEENTCH AND HIS SERVANT, SIR AVALANCHE!"<< endl; for (i=100;1>0;i--) { filut9<< "HAIL TZEENTCH AND HIS SERVANT, SIR AVALANCHE!"<< endl; } cout<< "HAIL TZEENTCH AND HIS SERVANT, SIR AVALANCHE!"<< endl; for (i=100;1>0;i--) { filut10<< "HAIL TZEENTCH AND HIS SERVANT, SIR AVALANCHE!"<< endl; } cout<< "HAIL TZEENTCH AND HIS SERVANT, SIR AVALANCHE!"<< endl; for (i=100;1>0;i--) { filut11<< "HAIL TZEENTCH AND HIS SERVANT, SIR AVALANCHE!"<< endl; } cout<< "HAIL TZEENTCH AND HIS SERVANT, SIR AVALANCHE!"<< endl; for (i = 100;i>0;i--) { cout<< "HAIL TZEENTCH AND HIS SERVANT, SIR AVALANCHE!"<< endl; cout<< "HAIL TZEENTCH AND HIS SERVANT, SIR AVALANCHE!"<< endl; cout<< "HAIL TZEENTCH AND HIS SERVANT, SIR AVALANCHE!"<< endl; cout<< "HAIL TZEENTCH AND HIS SERVANT, SIR AVALANCHE!"<< endl; cout<< "HAIL TZEENTCH AND HIS SERVANT, SIR AVALANCHE!"<< endl; cout<< "HAIL TZEENTCH AND HIS SERVANT, SIR AVALANCHE!"<< endl; } for (i =100; i>0; i--) { cout<< "BLESS THE CHANGER OF WAYS AND HIS SERVANT, SIR AVALANCHE: PRESS ONE!"<< endl; cin>> blessing; if (blessing !== 1) { cout<< "INFIDEL! TIME TO START ALL OVER AGAIN!"<< endl; goto start; } } }
spammer2.cpp: In function `int main()':
spammer2.cpp:5: error: `ofstream' undeclared (first use this function)
spammer2.cpp:5: error: (Each undeclared identifier is reported only once for each function it appears in.)
spammer2.cpp:5: error: expected `;' before "filut1"
spammer2.cpp:6: error: expected `;' before "filut2"
spammer2.cpp:7: error: expected `;' before "filut3"
spammer2.cpp:8: error: expected `;' before "filut4"
spammer2.cpp:9: error: expected `;' before "filut5"
spammer2.cpp:10: error: expected `;' before "filut6"
spammer2.cpp:11: error: expected `;' before "filut7"
spammer2.cpp:12: error: expected `;' before "filut8"
spammer2.cpp:13: error: expected `;' before "filut9"
spammer2.cpp:14: error: expected `;' before "filut10"
spammer2.cpp:15: error: expected `;' before "filut11"
spammer2.cpp:18: error: `cout' undeclared (first use this function)
spammer2.cpp:18: error: `endl' undeclared (first use this function)
spammer2.cpp:20: error: `filut1' undeclared (first use this function)
spammer2.cpp:24: error: `filut2' undeclared (first use this function)
spammer2.cpp:28: error: `filut3' undeclared (first use this function)
spammer2.cpp:32: error: `filut4' undeclared (first use this function)
spammer2.cpp:36: error: `filut5' undeclared (first use this function)
spammer2.cpp:40: error: `filut6' undeclared (first use this function)
spammer2.cpp:44: error: `filut7' undeclared (first use this function)
spammer2.cpp:48: error: `filut8' undeclared (first use this function)
spammer2.cpp:52: error: `filut9' undeclared (first use this function)
spammer2.cpp:56: error: `filut10' undeclared (first use this function)
spammer2.cpp:60: error: `filut11' undeclared (first use this function)
spammer2.cpp:73: error: `cin' undeclared (first use this function)
spammer2.cpp:74: error: expected primary-expression before '=' token
spammer2.cpp:79:2: warning: no newline at end of file
Process terminated with status 1 (0 minutes, 0 seconds)
28 errors, 1 warnings
_______________________________________
what is wrong? and, please tell me what command to use to run another program.
and don't just say "why do you want to do this?"
thanks. out.
•
•
Join Date: Jan 2008
Posts: 7
Reputation:
Solved Threads: 0
ok. this isnt a virus, just that a friend said that i couldn't make a program, so i9'm going to show him i can program. and this isnt very harmful, only creates ten files wich honour me. why i said that you shouldnt ask why was that i need the answer, not another question
Last edited by sir avalanche; Jan 30th, 2008 at 4:52 am.
So far your friend is right then!
Ooh that's so cruel.
What is 'start:' I'm no c/c++ expert but that doesn't look like valid syntax to me.
Also you need to prefix cout with std:: or put a using namespace std; at the top between your include directives and the main function. Main should really be int main(int argc, char *argv[])
You seem to have one too many closing braces on the last line.
Ooh that's so cruel.
What is 'start:' I'm no c/c++ expert but that doesn't look like valid syntax to me.
Also you need to prefix cout with std:: or put a using namespace std; at the top between your include directives and the main function. Main should really be int main(int argc, char *argv[])
You seem to have one too many closing braces on the last line.
•
•
•
•
So far your friend is right then!
What is 'start:' I'm no c/c++ expert but that doesn't look like valid syntax to me.

•
•
•
•
Also you need to prefix cout with std:: or put a using namespace std; at the top between your include directives and the main function. Main should really be int main(int argc, char *argv[])
You seem to have one too many closing braces on the last line.
Main can also be declared as
int main() , it's also standard.The brackets look ok to me, but due to avalanche's sloppy indention, I can't be sure
[edit] On second look, you might be right [/edit]
Niek
Last edited by niek_e; Jan 30th, 2008 at 5:19 am.
•
•
Join Date: Jan 2008
Posts: 7
Reputation:
Solved Threads: 0
•
•
•
•
So far your friend is right then!
Ooh that's so cruel.
What is 'start:' I'm no c/c++ expert but that doesn't look like valid syntax to me.
Also you need to prefix cout with std:: or put a using namespace std; at the top between your include directives and the main function. Main should really be int main(int argc, char *argv[])
You seem to have one too many closing braces on the last line.
•
•
Join Date: Jan 2008
Posts: 7
Reputation:
Solved Threads: 0
i know its a bad way to loop it, but here it WAS in a if statement, which makes it more forgivable?
![]() |
Similar Threads
- Help with problem (Java)
- Need help with the program i have written i am unable to correct the problems. please (C++)
- Program Problem with a select statement to access Data base (C)
- how will i repeat my whole game program? (Java)
- Urgent - problem with links (Windows NT / 2000 / XP)
- *Pointer program problem. (C++)
- File processing problem (C++)
- It's Alive!! Program with a mind of it's own.... (Computer Science)
Other Threads in the C++ Forum
- Previous Thread: problem with win32 GUI.....please help me
- Next Thread: graphics.h problem in VS.NET 2003 IDE
Views: 833 | Replies: 7
| Thread Tools | Search this Thread |
Tag cloud for C++
6 api application array arrays based beginner binary bmp c++ c/c++ calculator char char* class classes code compile compiler console conversion convert count data delete deploy dll download dynamiccharacterarray email encryption error file format forms fstream function functions game givemetehcodez graph homeworkhelp iamthwee ifstream input int java lib lines list loop looping loops map math matrix memory newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg search simple sort sorting spoonfeeding string strings struct temperature template templates text tree url variable vector video visual visualstudio void win32 windows winsock wordfrequency wxwidgets






