Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (1 invisible), 735 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
C or lite-c issue? #487600
06/13/23 17:41
06/13/23 17:41
Joined: Jun 2023
Posts: 8
Denia
Mishiwaka Offline OP
Newbie
Mishiwaka  Offline OP
Newbie

Joined: Jun 2023
Posts: 8
Denia
Hi everyone, I have an issue with a code that always returns a syntax error, but this time I can figure out what is really wrong ((( any help?
The error comes from line
double x = *(const double *)a;
and will definitely will pop up also from the next one

int compare(const void *a, const void *b)
{
double x = *(const double *)a;
double y = *(const double *)b;
if (x < y)
{
return -1;
}
else if (x > y)
{
return 1;
}
return 0;
}

Re: C or lite-c issue? [Re: Mishiwaka] #487604
06/14/23 13:14
06/14/23 13:14
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
Lite-C has some eccentricities. The compiler probably does not understand your casts.

Just make pointers to double and dereference them in your comparisons.

Re: C or lite-c issue? [Re: Mishiwaka] #487610
06/15/23 13:34
06/15/23 13:34
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Lite-C knows double, but not const.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1