Dumb vc question.
Displaying 1-3 of 3 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
TheGerf

I was thinking, what would this do?

int base_array[100];
int array[5];
int i;

base_array[array[i++]++]=i++;

Sorry, I'm at school and I'm bored...





TheGerf, not just any gerf.

Posted on 2001-01-15 14:20:14

grenideer

I've never put those incrementing ++ inside a variable array like that. I'm not sure if you could.
If you can, assuming i=0 since you didn't declare any value, whatever array[1] equals would be incremented by 1, and base_array[of that number] would end up equaling one. Really pointless actually.



Posted on 2001-01-15 14:56:44

andy

VC doesn't support incremental operators like real C does©

In real C, though, it would do this „I think, it's late¤
base_array[array[i]]=i+1;
array[i]++;
i+=2;

If you want a real thinker, try this:
--i=i++;
or
i++=++i;



'Never confuse a single defeat with a final defeat.' -F. Scott Fitzgerald

Posted on 2001-01-16 03:23:54


Displaying 1-3 of 3 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.