Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

is this bad?

Name: Anonymous 2013-08-27 12:46


struct something floattosomething(float f){
       struct something * ret = (struct something*)malloc(sizeof(struct something));
       ret->type = 3;
       ret->f = f;
       return *ret;
}

Name: Anonymous 2013-08-27 15:09

>>14
Your last example does return a copy. Your first post shows you don't know the pointer syntax quite well, so I recommend you to read on that.

I won't be replying anymore.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List