Re: I'm sorry...
- From: Manish Vachharajani <mvachhar vger rutgers edu>
- To: sml13 cornell edu
- cc: Tomas Ogren <stric ing umu se>, gnome-list gnome org, recipient list not shown: ;
- Subject: Re: I'm sorry...
- Date: Tue, 1 Dec 1998 10:40:05 -0500 (EST)
On Mon, 30 Nov 1998 sml13@cornell.edu wrote:
> Good point...BUT, this dies too:
>
> #include <stdio.h>
> #include <string.h>
>
> void main() {
> char* var = "hey you";
>
> printf ("%s\n", strtok (var, " "));
> }
>
> shane
This is no different, the pointer var still points to a constant string.
strtok dereferences the pointer and tries to write to the
dereferenced memory, which is read only.
Manish Vachharajani Some Haiku: A crash reduces
<mvachhar@vger.rutgers.edu> your expensive computer
to a simple stone - Unknown
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]