Re: why debug step by step, it s ok
- From: Robert Gamble <rgamble99@xxxxxxxxx>
- Date: Fri, 03 Jun 2005 11:55:40 -0400
On Fri, 03 Jun 2005 17:12:39 +0200, Emmanuel Delahaye wrote:
> baumann@pan wrote on 03/06/05 :
>> #include <stdio.h>
>> #include <string.h>
>>
>> int main() {
>> char *buf="5/90/45";
>
> char buf[]="5/90/45";
>
>> char *token;
>> char *lasts;
>>
>> printf("tokenizing \"%s\" with strtok():\n", buf);
>> if ((token = strtok(buf, "/")) != NULL) {
>> printf("token = \"%s\"\n", token);
>> while ((token = strtok(NULL, "/")) != NULL) {
>> printf("token = \"%s\"\n", token);
>> }
>> }
>> }
>
> strings are not mutable...
Psst: string _literals_ are not mutable.
Robert Gamble
.
- Follow-Ups:
- Re: why debug step by step, it s ok
- From: Keith Thompson
- Re: why debug step by step, it s ok
- References:
- why debug step by step, it s ok
- From: baumann@pan
- Re: why debug step by step, it s ok
- From: Emmanuel Delahaye
- why debug step by step, it s ok
- Prev by Date: Re: why debug step by step, it s ok
- Next by Date: Re: I think the question I just posted got lost.
- Previous by thread: Re: why debug step by step, it s ok
- Next by thread: Re: why debug step by step, it s ok
- Index(es):
Relevant Pages
|