RE: [Dev-C++] Help using the STL please!
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Daniel G. <sp...@ho...> - 2003-07-07 16:26:30
|
I got a load of linker errors from vector, but it compiles! Many thanks!!!
>From: "Smith, Jacob N." <jn...@ut...>
>To: 'Daniel Glenfield' <sp...@ho...>
>Subject: RE: [Dev-C++] Help using the STL please!
>Date: Mon, 07 Jul 2003 11:25:47 -0500
>
>Maybe include the header "<algorithm>". -j.
>
>-----Original Message-----
>From: Daniel Glenfield [mailto:sp...@ho...]
>Sent: Monday, July 07, 2003 11:21 AM
>To: dev...@li...
>Subject: [Dev-C++] Help using the STL please!
>
>
>Hi guys,
>page 1 of the book I'm going through and the code doesn't work. Header
>problem? Possibly. Take a look.
>It is complaining that 'sort' is undeclared. Now it auto-helps me with the
>function paramter list so it knows of it, but it will not compile under
>VC++
>
>6.0
>
>P.S. The book example doesn't say what headers to include, plus it has int
>main(), and no return value for the function. So mine looks slightly
>different in those respects.
>
>// Include the Standard Template Library
>#include <list>
>#include <vector>
>#include <iostream>
>#include <string>
>
>using namespace std;
>
>
>int main(int argc, char** argv)
>{
> // Create the container, in this case a vector.
> vector<string> StringVector;
> string TempString;
>
> while (getline(cin, TempString))
> {
> StringVector.push_back(TempString);
> }
>
> sort(StringVector.begin(), StringVector.end());
> copy(StringVector.begin(), StringVector.end(),
>ostream_iterator<string>(cout, "\n"));
>
> return 0;
>}
>
>'sort' is part of list I see from MSDN, so what's up? lol
>
>_________________________________________________________________
>Express yourself with cool emoticons - download MSN Messenger today!
>http://www.msn.co.uk/messenger
>
>
>
>-------------------------------------------------------
>This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data
>Reports, E-commerce, Portals, and Forums are available now. Download today
>and enter to win an XBOX or Visual Studio .NET.
>http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
>_______________________________________________
>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
>
_________________________________________________________________
Use MSN Messenger to send music and pics to your friends
http://www.msn.co.uk/messenger
|