Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, Grant, Neb), 908 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
cpp or c can write like it ,why lite_C can`t ? #401423
05/19/12 02:16
05/19/12 02:16
Joined: Dec 2009
Posts: 128
China
frankjiang Offline OP
Member
frankjiang  Offline OP
Member

Joined: Dec 2009
Posts: 128
China


void testf(int a = 0)
{

}


Error in 'MAIN' line 22: syntax error
< void testf(int a = 0)
>


cpp or c can write like it ,why lite_C can`t ?




development 3d game is interesting!
Re: cpp or c can write like it ,why lite_C can`t ? [Re: frankjiang] #401429
05/19/12 07:21
05/19/12 07:21
Joined: Apr 2008
Posts: 245
GameScore Offline
Member
GameScore  Offline
Member

Joined: Apr 2008
Posts: 245
i dont know why but try something like this

Code:
void testf(int a)
{
a=0;
}



Re: cpp or c can write like it ,why lite_C can`t ? [Re: frankjiang] #401430
05/19/12 08:24
05/19/12 08:24
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Originally Posted By: frankjiang
cpp or c can write like it ,why lite_C can`t ?


Lite-C is not C and doesn't share all features of the standard. If you want a similar behaviour, create an overloaded function:

Code:
void testf ()
{
    testf(0);
}

void testf (int a)
{
    // do something
}



Last edited by HeelX; 05/19/12 08:24.

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | 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