Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 6th, 2004, 12:00 AM   #1
systema
Newbie
 
Join Date: Nov 2004
Posts: 3
Rep Power: 0 systema is on a distinguished road
Quote:

#include <iostream>
#include <stdlib.h>

int main(int argc, char *argv[])
{

system("PAUSE");
return 0;
}


My first program, using this compiler. got this error:

C:/Dev-Cpp/include/c++/bits/stl_alloc.h:575: syntax error before `;' token
C:/Dev-Cpp/include/c++/bits/stl_alloc.h:575: confused by earlier errors, bailing out

make.exe: *** [main.o] Error 1

Execution terminated


-can anyone help me out please?--
systema is offline   Reply With Quote
Old Nov 6th, 2004, 12:16 AM   #2
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 6 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
These errors are from the compilers prewritten code "stl_alloc.h". Which i am assuming is called by #include <stdlib.h> which you dont need... so just remove it. This should work.

#include <iostream>

int main(int argc, char *argv[]) {
 * *system("PAUSE");
 * *return 0;
}

However a better way to accomplish this, so you can add your own pause message in if you want. Is this...

#include <iostream>
#include <conio.h> // Adds the getch() function, among other things...

int main(int argc, char *argv[]) {
  // Output our message to the screen
  std::cout << "Please press any key to continue..." << std::endl;

  // Pause program execution until a key is pressed...
  getch();

  // Exit the program
  return 0;
}
__________________

tempest is offline   Reply With Quote
Old Nov 6th, 2004, 12:28 AM   #3
Mjordan2nd
The Supreme Ruler
 
Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6 Mjordan2nd is on a distinguished road
~moved
__________________
&quot;Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children.&quot; - Dwight D. Eisenhower
Mjordan2nd is offline   Reply With Quote
Old Nov 6th, 2004, 12:51 AM   #4
kurifu
Expert Programmer
 
kurifu's Avatar
 
Join Date: Jul 2004
Location: Halifax, Nova Scotia (Canada)
Posts: 784
Rep Power: 5 kurifu is on a distinguished road
Send a message via ICQ to kurifu Send a message via MSN to kurifu
A syntactical error like this in a distributed header file is not a good thing, is it possible that you installed a corrupted version of the software or that you possibly modified that header file manually by accident?
__________________
Clifford Matthew Roche &lt;geek@cliffordroche.com&gt;
Web Hosting: http://www.crd-hosting.com
Consulting: http://www.crdev-consulting.com
kurifu is offline   Reply With Quote
Old Nov 6th, 2004, 1:36 PM   #5
systema
Newbie
 
Join Date: Nov 2004
Posts: 3
Rep Power: 0 systema is on a distinguished road
Hmm..I'll try reinstall and turning my firewall off. Thanks for your help.
systema is offline   Reply With Quote
Old Nov 6th, 2004, 2:00 PM   #6
systema
Newbie
 
Join Date: Nov 2004
Posts: 3
Rep Power: 0 systema is on a distinguished road
Works now, thanks for your help
systema is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:07 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC