Article View: att.lang.c++
Article #87Re: strtok()
From: John Harrison
Date: Mon, 08 May 2000 00:00
Date: Mon, 08 May 2000 00:00
26 lines
1608 bytes
1608 bytes
Henry Zektser <kdentdev@hotmail.com> wrote in message
news:8f547i$apj$1@bob.news.rcn.net...
> Hey all, I'm using MSVC++ 6.0 Enterprise and strtok(). The following code
> builds, and executes, but I get no output on cerr, is this a problem with
> strtok? MS's sample code doesnt work either...
> trying to do this:
> char LineContents[]="blah blah blah";
> char seps[]=" \n";
>
> token = strtok(LineContents, seps);
> cerr << "token (bl): " << token << endl;
> while( token != NULL )
> {
> cerr << "token: " << token << endl;
> token = strtok( NULL, seps );
> }
>
> H
>
Works on my MSVC++ 6, and theres not much wrong with the code. Your problem
is probably elsewhere, perhaps you've put cerr into an error state, or
closed it or something.
john
Technical Details
Message-ID:
<EjtR4.1151$Eu2.28297@news2-win.server.ntlworld.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<8f547i$apj$1@bob.news.rcn.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,e2c93d4356ee1452 X-Google-Attributes: gid109fba,public X-Google-Thread: 10d4ba,e2c93d4356ee1452 X-Google-Attributes: gid10d4ba,public From: "John Harrison" <jahhaj@dtn.ntl.com> Subject: Re: strtok() Date: 2000/05/08 Message-ID: <EjtR4.1151$Eu2.28297@news2-win.server.ntlworld.com> X-Deja-AN: 620549796 References: <8f547i$apj$1@bob.news.rcn.net> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 X-Complaints-To: abuse@net.ntl.com X-Trace: news2-win.server.ntlworld.com 957768036 194.168.244.90 (Mon, 08 May 2000 07:40:36 BST) Organization: ntl News Service X-MSMail-Priority: Normal Reply-To: "John Harrison" <jahhaj@bigfoot.com> NNTP-Posting-Date: Mon, 08 May 2000 07:40:36 BST Newsgroups: att.lang.c++,comp.lang.c++