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

C89 structs

Name: Anonymous 2010-08-30 0:37

Hi /prog/. When I program C I usually just use whatever features gcc allows without really worrying about different standards. However, I am now trying to learn strict C89. I know that it's no longer "standard" C, but I want to learn it anyways.

typedef struct {
    int a, b;
} s;


So normally, if I wanted to return an s from a function I would just use return (s) {1, 2};, but apparently that's not allowed in C89. So right now I'm using
s res;
res.a = 1;
res.b = 2;
return res;


Is there a better/shorter way to do this?

Thanks.

Name: Anonymous 2010-09-02 23:04

>>76
I think the AIX calling conventions will do this.  It's just that x86 has so few registers.

Name: Anonymous 2010-09-03 0:40

>>81
Why the fuck would you sage this? This thread is actually interesting, and you post an interesting and informative comment, and yet you sage. Now this thread is the last one on the page, and stupid shit like "interbutt radio" is on top.

sage is the cancer that is killing /prog/

Name: Anonymous 2010-09-03 3:17

>>82
Apart from the weak troll, I have to agree. /prog/riders should bump worthy threads and posts -- not that there's that many of them in the first place!

Name: Anonymous 2010-09-03 9:03

>>83
Nah.

Sage every post, and remove the front page entirely.

Name: Anonymous 2010-09-03 9:19

>>82
Since threads never die, it doesn't matter if they are on the front page or not.

Name: Anonymous 2010-09-03 14:25

>>85
Of course it does. If they leave the front page, readers don't see them, so the discussion ends.

Name: Anonymous 2010-09-03 14:44

>>86
Only readers with an inferior /prog/ client don't see them. These people rarely have anything to contribute anyway.

Name: Anonymous 2010-09-03 15:22

>>87
Haha.

Name: VIPPER 2010-09-03 16:50

on /vip/, we dont sage.

Name: VIPPER 2010-09-03 17:46

JEWS

Name: Anonymous 2010-09-03 17:56

>>86
I don't see why you should flood the front page with your crap just because you don't understand how to maintain a conversation.

Name: Anonymous 2010-09-03 19:19

No one ever has ``discussions" past the front page.
Stop kidding yourself.

Name: Anonymous 2010-09-03 21:03

>>92
It's a nice place to have a monologue, bump the thread, and then be indignant at yourself to pretend people do, though.

Name: Anonymous 2010-09-04 2:14

>>82
thanks for ruining the thread, asshole.

Name: Anonymous 2010-11-27 23:39


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