Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com From: "Dave Korn" To: Subject: [OT] RE: g++ include string.h Date: Mon, 17 May 2004 19:32:36 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit In-Reply-To: Message-ID: X-OriginalArrivalTime: 17 May 2004 18:32:36.0882 (UTC) FILETIME=[53BD8F20:01C43C3D] > -----Original Message----- > From: cygwin-owner On Behalf Of Christian Rudiger > Sent: 17 May 2004 19:00 > Hi there, > > i'm kind of newbee to c++ programming and try to do my first > steps with > the gcc in delivered with cygwin. > > I'd like to include the string.h into my little program but it wasn't > found as the compiler doesn't accept my string declarations. #1: string.h has nothing to do with the c++ string class. string.h is the old c-style functions, string (no extension) contains the C++ string class. #2: If a header file wasn't found, the compiler would issue an error or warning, not just silently ignore it. #3: All the standard C++ classes live in a namespace called 'std', so you want to refer to them either as "std::string" or have a "using namespace std;" statement at the top of your file. #4: None of this is remotely cygwin-specific; you want to read a basic tutorial on C++/stl programming. There are problems with the rest of your code as you'll see once you've added the namespace line, but it's all completely generic c++ stuff and this won't be the right place to bring them up. cheers, DaveK -- Can't think of a witty .sigline today.... -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/