All pastes #518902 Raw Edit

The Kid

public c v1 · immutable
#518902 ·published 2007-05-29 13:46 UTC
rendered paste body
#include <stdio.h>#include <stdlib.h>#include <string.h>#define MAX_SIZE 1024int main( int argc, char ** argv ){	struct person {		char *name;		char *surname;	};		struct person *me = (struct person *)malloc(sizeof(struct person));	if( me == NULL ) {		printf("ERROR: Not enough memory\n");		return 1;	}	me->name = malloc(MAX_SIZE);	strcpy(me->name, "Vasya"); //Segmentation fault	strcpy(me->surname, "Pupkin");	printf("Ny name is %s %s\n", me->name, me->surname);	return 0;}