Mail Archives: djgpp/2002/09/23/19:33:00
At 06:10 p.m. 23/09/2002 -0400, you wrote:
>Hello everyone. I'm sure this will be the first of many questions as I
>embark upon my programming adventure :)
>
>Okay. Here's my scenario:
>
>As I said in my recent hello letter, I took a few programming classes in
>high school so I hope to pick up the syntax and commands rather quickly.
>I've been reading through the Programming in C++ tutoral at
>http://www.cprogramming.com/tutorial.html. Lesson one gives the example:
This tutorial is outdated. Consider get a recent (and decent) C++ book
:) Maybe
http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html
>#include <iostream.h>
This is deprecated. Better use
#include <iostream>
use namespace std;
>int main()
>{
> cout<<"HEY, you, I'm alive! Oh, and Hello World!";
> return 0;
>}
>
>After having entered the preceeding code and having saved it as hello.cpp,
>I wish to compile it. Refering to the online users' guide at
>http://www.delorie.com/djgpp/doc/ug/basics/compiling.html, I enter:
>
>gcc hello.c -o hello.exe
Are you coding C++ or C? For C++ files, use .cpp extension, and type at
command line.
gpp hello.cpp -o hello.exe
[snip]
>I mearly receive the error message, "Program too big to fit in memory"
>when I attempt to run it.
Maybe your system needs to be configurated. See FAQ sec. 3.9 at
http://www.delorie.com/djgpp/v2faq/faq3_9.html
>So here're my quetions:
>
>1) Am I at least using the correct command/syntax to compile a c++ program?
No.
>2) It's obviously done something with hello.cpp, but what exactly did gpp
>do, and what then is the hello.exe file?
Do you use gpp?
>3) If I were to use a "non-depreciated" header, like gpp suggests, which
>is the iostream.h equivelant... and does the new .h still use the
>functions cout, cin, etc.?
See above.
>I want to say thanks for your help in advance. I admit to being a
>"newbie," but hey, we've all got to start out somewhere, and with brain
>like a sponge, I'm eager and willing to learn. :)
>
>-Tim
You're welcome.
Regards
J. L.
- Raw text -