Tnil
如何将变量name_to_main的值返回到指针* p_name?
答案 0 :(得分:0)
#include <stdio.h>
#include <stdlib.h>
char*pointer(char*now);
void main() {
char*name = "Paz Leviim", **p_name = &name;
*p_name = pointer(*p_name);
printf("Now it's %s", *p_name);
getchar();
}
char*pointer(char*now) {
static char name_to_main[100];
printf("The value now is %s\nPlease set value:",now);
scanf_s("%[^\n]%*c", &name_to_main,100);
return name_to_main;
}
现在全部工作:)