Andrew Channels Dexter Pinion

Wherein I write some stuff that you may like to read. Or not, its up to you really.

December 13, 2001

C Programming

This is why I hate coding in c. The simplest program in the world;

#include <stdio.h>
int main()
{
    char *string = '\0';
    strcpy(string, "my string"):
}

Core dumps. If I change the definition of 'string' to char string[255]; everything is hunky dory.

I don't know why, but I'm bloody well going to find out.

Posted by Andy Todd at December 13, 2001 02:11 PM

Comments