Anyone understands what's wrong here? Just a simple thing, define a struct and a function set returning a variable
of that struct test type.
typedef struct{float var1;
}test;
test set();
main(){
test v1;
v1=set(1.0);
}
test set(float myval){
test t1 ;
t1.var1=myval;
return t1;}
This fails to compile with:
10: conflicting types for `set'
10: an argument type that has a default promotion can't match an empty parameter name list declaration
4: previous declaration of `set
of that struct test type.
typedef struct{float var1;
}test;
test set();
main(){
test v1;
v1=set(1.0);
}
test set(float myval){
test t1 ;
t1.var1=myval;
return t1;}
This fails to compile with:
10: conflicting types for `set'
10: an argument type that has a default promotion can't match an empty parameter name list declaration
4: previous declaration of `set