gdb-intro-kwlug/examples/points/hello.c

29 lines
307 B
C
Raw Normal View History

/* hello.c -- Segfault example. */
#include <stdio.h>
#include <string.h>
int
print (char *msg)
{
printf ("%s\n", msg);
return 0;
}
int
hello (char *param)
{
strcpy (param, "Hello World!");
print (param);
}
int
main (int argc, char **argv)
{
char *str = "Hi!";
hello (str);
return 0;
}