Basically I am trying to assign a value to a struct through a function,so that the value that I've assigned is the same on main() afterwards.
The struct
struct member{
char name;
int age;
}m1;
void assigntostruct(struct member str,int age){
str.age = age;
main(){
int age=10;
assigntostruct(m1,age);
printf("%d",age);
}
I've tried it like this, the value "age" is passed to str.age, but then when I printf it returns 0.