arrays in function arguments
Displaying 1-4 of 4 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
basil

Am I correct in thinking arrays cannot be used as a function argument?

e.g.

int beef[10];
erase(beef);

Is there any relatively elegant way around this?

Posted on 2004-07-15 22:09:21

rpgking

There is no call-by-reference stuff like that in Verge3...

But strings in Verge3 can be of almost any length, and it has great string tokenizer functions... So, you could basically imitate a dynamic array using a string list, and pass that string into the function.

I don't know how performance would be affected though if you use strings.

Posted on 2004-07-15 22:14:22

Gayo

It would be affected a lot, I am guessing. You're basically fucked if you want to pass by reference. I've heard tell that this may be amended someday in the future, but the functionality may not extend to arrays.

Posted on 2004-07-16 01:21:32

mcgrue

I'm not sure if vecna's put the get/set-by-name functions for arrays yet.

Posted on 2004-07-16 02:21:27


Displaying 1-4 of 4 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.