Gamestudio Links
Zorro Links
Newest Posts
Alternative to Stooq for Zorro S
by cwford. 10/09/26 21:13
Stooq now requires an API key
by cwford. 10/08/26 23:27
ZorroGPT
by TipmyPip. 10/06/26 05:32
Purchase A8 full licence version
by jcl. 10/05/26 12:12
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (ukgamer), 8,201 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
JimSimons, julienp, julienper, KelleyAbbey, Yopachi
19246 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,835
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,835
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: 28,140
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

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


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1