From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3778 invoked by alias); 1 Sep 2004 14:20:22 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 3765 invoked from network); 1 Sep 2004 14:20:19 -0000 Received: from unknown (HELO hotmail.com) (64.4.35.18) by sourceware.org with SMTP; 1 Sep 2004 14:20:19 -0000 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Wed, 1 Sep 2004 07:17:08 -0700 Received: from 130.233.19.1 by by12fd.bay12.hotmail.msn.com with HTTP; Wed, 01 Sep 2004 14:17:08 GMT X-Originating-IP: [130.233.19.1] X-Originating-Email: [learning_c@hotmail.com] X-Sender: learning_c@hotmail.com From: "learning c++" To: gcc-help@gcc.gnu.org Bcc: Subject: for argument `1' to `int strcmp(const char*, const char*) Date: Wed, 01 Sep 2004 14:20:00 -0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 01 Sep 2004 14:17:08.0812 (UTC) FILETIME=[5DB2F0C0:01C4902E] X-SW-Source: 2004-09/txt/msg00008.txt.bz2 Hi, I hope to use the build in function ""strcmp()" in C++, but I can not deal with it. My code is like this: #include #include #include #include using namespace std; int main(){ vector v1; vector::iterator iter; string s; do{ cout <<"please input something:" <>s; v1.push_back(s); }while (!(strcmp(s,"quit"))); for(iter=v1.begin(); iter!=v1.end();iter++) cout <<*iter<, std::allocator > >' to `const char*' for argument `1' to `int strcmp(const char*, const char*)' I know now "s" is an object of string. How can I compare it with a string, like ""quit"? Are there some methods in String class? Thanks, _________________________________________________________________ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail