Re: [Dev-C++] code with cout statement (no display)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <go...@fo...> - 2003-10-24 12:19:15
|
Hi Mic,
I tried your code. It works fine on my machine(500MHz,250MB RAM, win2k
sp4).
One comment though:
The line
using namespace std;
does exactly what it says, that is; names should be interpreted according
to std. This means that doing std::cout<<blabla... is overkill. Just
cout<<blabla... is enough.
In fact you can define your own namespace (don't ask me how) where you
might specify that cout should mean something else. Putting
using namespace mynamespace;
would imply your implementation of cout rather than the std (standard) one.
But if you then wanted the standard cout then you would have to do
std::cout<<blabla...
(or if you omitted the using namespace std;-line)
Cheers
G=F6sta
*********** REPLY SEPARATOR ***********
On 2003-10-23 at 20:43 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.
>
>
>
>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>
>#include <iostream>
>
>//using the & and * operators
>
>
>
>using namespace std;
>
>
>
>int main(){
>
>int a;
>
>int *aPtr;
>
>a=3D7;
>
>aPtr=3D &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;
>
>}
>
>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>
>
>
>
>
>_______________________________________________
>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
|