Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Konsti, AndrewAMD, 1 invisible), 1,376 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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,729
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,729
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