System pause messing my program?

Started by
11 comments, last by fivepointo 21 years, 6 months ago
quote:Original post by fivepointo
Thanks, but it appearsto have stopped working > . Sorry bout this...

// Listing 2.2 using cout#include <cstdlib>using namespace std;int main(){  cout << "Hello There.\n";  cout << "Here is 5: " << 5 << "\n";  cout << "The manipulator endl writes a new line to the screen." <<  endl;  cout << "Here is a very big number:\t" << 70000 << endl;  cout << "Here is the sum of 8 and 5:\t" << 8+5 << endl;  cout << "here''s a fraction:\t\t" << (float) 5/8 << endl;  cout << "And a very very big number:\t" << (double) 7000 * 7000 <<  endl;  cout << "Jamie Smith is a c++ programmer!\n";  int  system ( const char * PAUSE );  return 0;}   


It gives me this error.
"19 c:\docume~1\jamie\desktop\listings\2.2\progra~1.cpp
implicit declaration of function `int system(...)''"

Tried cstdlib.h and cstdlib- neither worked, just created 8 errors.


[edited by - fivepointo on October 16, 2002 11:07:12 AM]



you forgot iostream
Advertisement
Yeah mockjock already gave me the solution. Thx neways
Ass up high, make a mother fu**er cry help me stay aliv.the time is right i wanna feel it good 'n' tight i'm going to do this alone i'm gonna feel it upright.
quote:Original post by fivepointo
Coolio. I was actually thinking of stopping C++ right now and learning java, as i've heard many ppl(including you) say it's easier than c++. C++ is my first programming language, part from html(but that aint very good as a prog introduction, cause there r no procedures or functions or anything).


It's much of a muchness, to be honest. Java does present some obstacles - for example, you're forced into using object oriented programming. That can be a little annoying to grasp, especially if you've not done things the easy (procedural) way. You'll learn some things more quickly (classes, for example) with Java because you're forced to use it, but sometimes that extra OO can get in the way.

Garbage collection is a nice feature when it works. It means that you don't have to worry about deallocating any objects that you create.

If you want to use Java, I won't stand in your way. However, it would be a little bit of a shame if you've gone and got books + spent so long on the compiler . If you want to stick with C++ then there are plenty of people who know it. If you want Java then there's a forum at this site too.

You can get Java from over here: http://java.sun.com/j2se/1.4/download.html (I think). It's a fairly big download though. Also, you need to get your hands on an IDE to do your stuff. People can't code effectively in Notepad for a long time.

Check out the Java forum here - there are always a few questions about the IDE. Eclipse, JBuilder and JCreator and often stated as good ones (plus some others).

If you want a tutorial, check out http://developer.java.sun.com/developer/onlineTraining/. Choose either the Java language tutorial or the Swing tutorial (which is the standard GUI toolkit for Java, replacing the older AWT).

However, you'll be looking at console apps for a while even if you use Java. It's entirely up to you (and quite possibly an excuse to start another language war, w00t!).

EDIT: fixed Java SDK link

[edited by - Alimonster on October 16, 2002 11:34:19 AM]

This topic is closed to new replies.

Advertisement