29 lines
307 B
C
29 lines
307 B
C
|
/* 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;
|
||
|
}
|