Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (TipmyPip, AndrewAMD), 12,726 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 4 of 4 1 2 3 4
Re: the comparisons of if clauses are still executed completely [Re: Uhrwerk] #360437
02/23/11 22:30
02/23/11 22:30
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Quote:
functions with a variable argument number

Works fine for me (or am I missing sth?) :
Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>
///////////////////////////////


var add(var x, var y, var z) {
	return (x+y+z);
}

var add(var x, var y) {
	return (x+y);
}

void main() {
	video_screen = 0;
	printf("\n%d",(int)add(1,2));
	printf("\n%d",(int)add(1,2,3));
}




"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: the comparisons of if clauses are still executed completely [Re: Superku] #360438
02/23/11 22:34
02/23/11 22:34
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
The problem is that variadic functions don't work. Your example is just overloarding, but what Uhrwerk means is something like this:

Code:
void foo(char *format, ...)
{
   va_list args;
   va_start(args, format);

   // Do something with the format string

   va_end(args);
}



Btw, declaring functions which take variable arguments is already supported, but va_list, va_start, va_arg, va_end and va_copy is missing.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Page 4 of 4 1 2 3 4

Moderated by  aztec, Spirit 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1