|
From: Ioannis V. <no...@ya...> - 2001-10-22 19:52:17
|
Also check http://www.research.att.com/~bs/3rd_notes.pdf which is a peice of Stroustrup's Special Edition. Be sure to check http://www.research.att.com/~bs which is the page of Bjarne Stroustrup (the creator of C++).=20 =20 This is the page of Special Edition: http://www.research.att.com/~bs/3rd.html =20 =20 Ioannis =20 * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com <http://www.noicys.f2s.com/>=20 * Alternative URL: http://run.to/noicys =20 -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Daniel Glenfield Sent: Monday, October 22, 2001 8:06 PM To: dev...@li... Subject: RE: [Dev-C++] using strings Are you sure? I was taught to always ALWAYS do <iostream.h> . Even when they spoke about it in my course they said iostream.h >From: "Ioannis Vranos"=20 >To: "Dev-C++"=20 >Subject: RE: [Dev-C++] using strings=20 >Date: Mon, 22 Oct 2001 14:23:17 +0200=20 >=20 >string.h is the C header file. ANSI C++ header files are without .h and >more properly written:=20 >=20 >#include=20 >#include // For setw()=20 >#include // For file I/O=20 >#include=20 >=20 >=20 >=20 >int main()=20 >{=20 > using namespace std;=20 >=20 > string s1;=20 > char pause;=20 >=20 > cin >> s1;=20 > cout << endl << s1 << endl;=20 > cout << "pause";=20 > cin >> pause;=20 >=20 >}=20 >=20 >=20 >return 0; is not needed in ANSI C++. If in main() you do not return any >value, 0 is automatically returned to the system.=20 >=20 >=20 >Ioannis=20 >=20 >* Ioannis Vranos=20 >* Programming pages: http://www.noicys.f2s.com=20 >=20 >* Alternative URL: http://run.to/noicys=20 >=20 >=20 >-----Original Message-----=20 >From: dev...@li...=20 >[mailto:dev...@li...] On Behalf Of Daniel=20 >Anderson=20 >Sent: Sunday, October 21, 2001 7:38 PM=20 >To: dev...@li...=20 >Subject: [Dev-C++] using strings=20 >=20 >=20 >Hello,=20 >A seemingly simple problem has stumped me so far. I cannot figure out=20 >how to use simple strings in my programs. Do I need to add the=20 > library? If so, my compiler says it can't find it- can I=20 >download this somewhere? I know I can get around this problem by using=20 >an array of chars, but I want to be able to use strings. I am using Dev >4.01 and the mingw compiler 2.95.2-1. A thousand thanks for any help.=20 >=20 >D=20 >=20 >When I try to compile this program, I can a 'string' undeclared (first=20 >use this function) error.=20 >// start=20 >=20 >#include=20 >#include // For setw()=20 >#include // For file I/O=20 >#include=20 >=20 >using namespace std;=20 >=20 >int main()=20 >{=20 > string s1;=20 > char pause;=20 >=20 > cin >> s1;=20 > cout << endl << s1 << endl;=20 > cout << "pause";=20 > cin >> pause;=20 >=20 >=20 > return 0;=20 >}=20 >=20 _____ =20 Get your FREE download of MSN Explorer at http://explorer.msn.com <http://go.msn.com/bql/hmtag_itl_EN.asp>=20 _______________________________________________ Dev-cpp-users mailing list Dev...@li... https://lists.sourceforge.net/lists/listinfo/dev-cpp-users=20 |