By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,649 Members | 696 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,649 IT Pros & Developers. It's quick & easy.

c++ help needed

P: n/a
Well in bloodshed c++ i am able to run the following program :
Code:
#include <iostream.h>
using namespace std;

int main()
{
cout << "Hello World!" << endl;
cout << "Press any key to continue." << endl;
cin.get();
return 0;
}


I am using the .h extension which don't support namespaces and still
able to run it .
what the hell ?

Also Code:
#include <iostream.h>
#include<string.h //how can i use that ?
using namespace std; //with this ?

int main()
{
cout << "Hello World!" << endl;
cout << "Press any key to continue." << endl;
cin.get();
return 0;
}

Jun 18 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
<ak**********@gmail.comwrote in message
news:11*********************@q19g2000prn.googlegro ups.com...
Well in bloodshed c++ i am able to run the following program :
Code:
#include <iostream.h>
using namespace std;

int main()
{
cout << "Hello World!" << endl;
cout << "Press any key to continue." << endl;
cin.get();
return 0;
}


I am using the .h extension which don't support namespaces and still
able to run it .
what the hell ?

Also Code:
#include <iostream.h>
should be <iostreambut I guess bloodshed has this old one kicking aroiund
that may be pre-standard, not sure.
#include<string.h //how can i use that ?
This is the old C header for c-style strings. strcpy, strcmp, etc...
<cstringis the std namespace version of it.
<stringis the one for std::string.

Try to actually create a std::string in your program and you should get an
error becuase std::string is not defined.
using namespace std; //with this ?

int main()
{
cout << "Hello World!" << endl;
cout << "Press any key to continue." << endl;
cin.get();
return 0;
}

Jun 18 '07 #2

P: n/a

Jim Langston wrote in message...
<ak**********@gmail.comwrote in message...
Well in bloodshed c++ i am able to run the following program :
Code:
#include <iostream.h>

I am using the .h extension which don't support namespaces and still
able to run it . what the hell ?

Also Code:
#include <iostream.h>

should be <iostreambut I guess bloodshed has this old one kicking
aroiund
that may be pre-standard, not sure.
Not 'bloodshed' (Dev-C++ IDE), it's GCC(MinGW):

<root>\Dev-Cpp\include\c++\3.3.1\backward\iostream.h.

Seems like that should never have been there after the 2.95 series, IMHO.

[ note to self: upgrade that poor old (3.3.1) puppie!! <G]
--
Bob R
POVrookie
Jun 18 '07 #3

P: n/a
On Jun 18, 10:56 pm, "BobR" <removeBadB...@worldnet.att.netwrote:
Jim Langston wrote in message...
<akshaycjo...@gmail.comwrote in message...
Well in bloodshed c++ i am able to run the following program :
Code:
#include <iostream.h>
I am using the .h extension which don't support namespaces and still
able to run it . what the hell ?
Also Code:
#include <iostream.h>
should be <iostreambut I guess bloodshed has this old one kicking
aroiund
that may be pre-standard, not sure.

Not 'bloodshed' (Dev-C++ IDE), it's GCC(MinGW):

<root>\Dev-Cpp\include\c++\3.3.1\backward\iostream.h.

Seems like that should never have been there after the 2.95 series, IMHO.

[ note to self: upgrade that poor old (3.3.1) puppie!! <G]
--
Bob R
POVrookie
But how to update ???
Can u end me the link ?

Jun 19 '07 #4

P: n/a

<ak**********@gmail.comwrote in message ...
On Jun 18, 10:56 pm, "BobR" wrote:
Jim Langston wrote in message...
should be <iostreambut I guess bloodshed has this old one kicking
aroiund that may be pre-standard, not sure.
Not 'bloodshed' (Dev-C++ IDE), it's GCC(MinGW):
<root>\Dev-Cpp\include\c++\3.3.1\backward\iostream.h.

But how to update ???
Can u end me the link ?
If you have the latest from Bloodshed, just use <iostream>, like Jim said.
Dev-C++ IDE: http://www.bloodshed.net/

If you want to check for newer compiler version:
MinGW (GNU compiler): http://www.mingw.org/

--
Bob R
POVrookie
- - other IDEs
MinGWStudio http://www.parinyasoft.com/
Code::Blocks http://www.codeblocks.org/
Jun 19 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.