Code: Select all
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int f1(char **foo){
char label[] = "Single";
printf("%s\n", label);
*foo = label;
printf("%s\n", *foo);
return 0;
}
int main()
{
char *foo1 = NULL;
f1(&foo1);
printf("%s\n", foo1);
return 0;
}
Code: Select all
Single
Single
Code: Select all
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int f1(char **foo){
char *label = "Single";
printf("%s\n", label);
*foo = label;
printf("%s\n", *foo);
return 0;
}
int main()
{
char *foo1 = NULL;
f1(&foo1);
printf("%s\n", foo1);
return 0;
}
Code: Select all
Single
Single
Single