Re: [Dev-C++] code with cout statement (no display)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Maya <esc...@vi...> - 2003-10-25 17:24:44
|
Just a suggestion:
Wouldn't it be better to have the below program a bit more portable?
You can do that by replacing system("pause") with std::cin.get() ;-)
Earlier in your postings I suggested to use 'std::cout', well in your
case you don't need to any more; since you have already declare 'using
namespace std'. No harm done though, just redundancy.
The program should be working, but I can't see why it is not, however I
will throw an idea:
Test the 'iostream' by writing another program, a simple one, no
pointers, no addresses ops, etc. just a simple string i.e.
int main(){ std::cout << "COUT is working" << std::endl; return 0;}
If it works, than you know that GCC was installed properly and that the
iostream is all hunkydory. Since the program works under UNIX, which is
the all mighty of all OSs, than get rid of that Fucking poor excused of
an OS called MS-Windows. Ooops, sorry I always loose it when it comes to
that thing called MostlySuckers-Windows.
Have a good one, and if you are going to have more than one... call me, eh!
Mic wrote:
>Hello all
>
>
>
>And thanks for your mails. I'm including the code I'm trying to run on Dev-cpp (which by the way works fine on unix).
>
>The statements do not display on my DOS terminal.
>
>
>
>======================================================================
>
>#include <iostream>
>
>//using the & and * operators
>
>
>
>using namespace std;
>
>
>
>int main(){
>
>int a;
>
>int *aPtr;
>
>a=7;
>
>aPtr= &a;
>
>system ("pause");
>
>
>
>std::cout << "Hello World! \n";
>
>
>
>std::cout << "The address of a is" << &a
>
> << "\n The value of aPtr is" << aPtr;
>
> system ("pause"); // execute M$-DOS' pause command
>
> return 0;
>
>}
>
>=====================================================================
>
>
>
>
>
>_______________________________________________
>Join Excite! - http://www.excite.com
>The most personalized portal on the Web!
>
>
>-------------------------------------------------------
>This SF.net email is sponsored by: The SF.net Donation Program.
>Do you like what SourceForge.net is doing for the Open
>Source Community? Make a contribution, and help us add new
>features and functionality. Click here: http://sourceforge.net/donate/
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
>
>
|