D
daniel
Hello ,
How safe is it to return a structure from a function.
Let's say we have the following situation:
typedef struct MyStruct{
int a;
char b;
} MyStruct;
MyStruct foo(void){
MyStruct s;
s.a = 2;
s.b = '1';
return s;
}
When function returns s , it must somehow make a "raw" copy of s? Is
this copy consistent.
I mean s.b will be '1' after foo call ?
Thanks,
Dan.
How safe is it to return a structure from a function.
Let's say we have the following situation:
typedef struct MyStruct{
int a;
char b;
} MyStruct;
MyStruct foo(void){
MyStruct s;
s.a = 2;
s.b = '1';
return s;
}
When function returns s , it must somehow make a "raw" copy of s? Is
this copy consistent.
I mean s.b will be '1' after foo call ?
Thanks,
Dan.