J
Jeff
Hello everybody,
I just have a little problem, and I just can't figure out what it is:
[gongds @ labtherm][15:52:28]$ cat test.c
#include <stdio.h>
int main (void)
{
char* s = "CAT";
*(s+1) = 'B';
printf("%s", s);
return (0);
}
[gongds @ labtherm][15:52:32]$ gcc -o test test.c
[gongds @ labtherm][15:52:40]$ ./test
Segmentation fault (core dumped)
[gongds @ labtherm][15:52:42]$
Just what am I doing wrong here? Just for information this 'code' was
compiled using GCC under cygwin, on a windows 98 machine.
Thank-you for any help,
Cheers!
I just have a little problem, and I just can't figure out what it is:
[gongds @ labtherm][15:52:28]$ cat test.c
#include <stdio.h>
int main (void)
{
char* s = "CAT";
*(s+1) = 'B';
printf("%s", s);
return (0);
}
[gongds @ labtherm][15:52:32]$ gcc -o test test.c
[gongds @ labtherm][15:52:40]$ ./test
Segmentation fault (core dumped)
[gongds @ labtherm][15:52:42]$
Just what am I doing wrong here? Just for information this 'code' was
compiled using GCC under cygwin, on a windows 98 machine.
Thank-you for any help,
Cheers!