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

Pages: 1-

2 returns giving another methode

Name: Anonymous 2011-05-30 7:25

i want to do that

        String^ error() {
            String ^x= "penis";
            String ^y= "wurst";
        return x,y;
        }
and then
 MessageBox::Show(error()) its work but it just shows wurst the place for penis is empty

Name: Anonymous 2011-05-30 7:36

You can't return two values in C++/CLI.

return x,y; returns y, the comma here is the so-called "comma operator", primarily used in for loops (to do "for (i = 0, j = len; i < j; i++, j--)" and such). It returns the second argument.

Doesn't the fact that your function is declared as returning String^, not the pair of strings, make you think?

If you want to return a single string, but composed of two strings, do just that, return x + " " + y.

Also, please use code tags.

Name: Anonymous 2011-05-30 8:13

the place for penis is empty

Name: Anonymous 2011-05-30 8:16

hax u anus u se.. wait wut a serious answer a noob question didnt expect that well dont know any more what u do in that case xht?

Name: Anonymous 2011-05-30 9:41

>>2
"Doesn't the fact that your function is declared as returning String^, not the pair of strings, make you think?"

You shouldn't be preaching about how peoople should "think" since you are mixing up a function declaration and its definition.

Name: Anonymous 2011-05-30 9:54

>>2
"return x,y; returns y, the comma here is the so-called "comma operator", primarily used in for loops (to do "for (i = 0, j = len; i < j; i++, j--)" and such). It returns the second argument."

Also, I believe the correct term for the "comma operator" is the "sequence point".

http://en.wikipedia.org/wiki/Sequence_point

But don't quote me on that since you are the fag that is telling other people to "think".

Name: Anonymous 2011-05-30 9:57

YHABT

Name: Anonymous 2011-05-30 9:59

>>7
Bitch, pull my finger.

Name: Anonymous 2011-05-30 10:06

>>6
In C and C++, sequence points occur in the following places. [list of example expressions that do not use commas exclusively]
The comma operator is a sequence point, not the sequence point.

Name: Anonymous 2011-05-30 10:10

>>9
And what happens when I do something like the following

int a = 1;
int b = 2;

a,b;

Wouldn't the "comma operator" be the sequence point since there is only one fucking comma?

Name: Anonymous 2011-05-30 10:12

>>9
By the way, I don't know if the moron that was telling the OP to "think" is trolling or is just plain stupid.

Name: Anonymous 2011-05-30 10:23

>>10
It is indeed the only sequence point in that particular example. But calling it 'the' sequence point everywhere is wrong, as the or in a || b is also a sequence point, as the article in >>6 clearly states.

Name: Anonymous 2011-05-30 10:25

>>12
And calling it a sequence point is also wrong. This is evident by the fact that the wording omits both "the" and "a".

Name: Anonymous 2011-05-30 10:30

>>13
The comma operator is a sequence point
Okay.

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