From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24046 invoked by alias); 11 Sep 2004 20:13:43 -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 24037 invoked from network); 11 Sep 2004 20:13:42 -0000 Received: from unknown (HELO smtp05.web.de) (217.72.192.209) by sourceware.org with SMTP; 11 Sep 2004 20:13:42 -0000 Received: from [145.254.89.218] (helo=localhost.localdomain) by smtp05.web.de with esmtp (WEB.DE 4.101 #44) id 1C6EFh-0004LB-00 for gcc-help@gcc.gnu.org; Sat, 11 Sep 2004 22:13:41 +0200 Date: Sat, 11 Sep 2004 20:13:00 -0000 Subject: simple c question Message-ID: <20c7d8ba1316ed489482482e65447c99@dialin-145-254-089-218.arcor-ip.net> MIME-Version: 1.0 (Generated by Pantomime 1.1.2) From: max To: gcc-help@gcc.gnu.org Reply-To: m.marcoll@web.de Content-Type: text/plain; charset="us-ascii"; format="flowed" X-Sender: m.marcoll@web.de X-SW-Source: 2004-09/txt/msg00097.txt.bz2 hi! i'm new to this list and i hope i'm not bothering you with this simple stuff: i'm having problems with strings. i want to get a path without filename into a string. and the code is this: ///////////////////////////////////////////////// // string.h included of course... char * GetPath (char * string) { char * path; int i, pos=-1; for(i=0;string[i]!=0;i++) { if(string[i]=='/') pos=i; } if(pos==-1) return NULL; strncpy(path, string, pos+1); return path; } //////////////////////////////////////////// i don't get it to work. can someone please help me? thank you! -- ----------------------------------------------- ----------------maximilian marcoll------------- -----------composition | performance----------- http://icem-www.folkwang-hochschule.de/~marcoll -----------------------------------------------