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); } }
1 Answer
+ 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);
}