0

Can value in one function is transfer to another function in c

#include<stdio.h> int main() { string name[20]; void one() { printf("Enter name"); scanf("%s",name); } void two() { printf("your name is",name); } }

15th Nov 2018, 4:51 PM
Shruti Nayak
1 Antwort
+ 3
This #include <stdio.h> int main() { string name[20]; void one() { printf("Enter name"); scanf("%s", name); } void two() { printf("your name is", name); } } must be this #include <stdio.h> void one(char *name); void two(char *name); int main() { char name[20]; one(name); } void one(char *name) { printf("Enter name"); scanf("%s", name); two(name); } void two(char *name) { printf("your name is %s", name); }
15th Nov 2018, 6:37 PM
Babak
Babak - avatar