Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
81 user(s) are online (68 user(s) are browsing Forums)

Members: 0
Guests: 81

more...

Support us!

Headlines

Report message:*
 

Re: signed char became unsigned ?

Subject: Re: signed char became unsigned ?
by kas1e on 2021/1/21 20:00:36

Damn right, win32:

cat test.cpp
#include <stdio.h>
int main()
{
        
char _direction;
        
_direction = -1;
        
printf("_direction = %dn",_direction);
}

gcc test.cpp -o test
$ ./test
_direction 
= -1



Amigaos4:

2/10.Work:testcat test.cpp
#include <stdio.h>
int main()
{
        
char _direction;
        
_direction = -1;
        
printf("_direction = %dn",_direction);
}

2/10.Work:testgcc test.cpp -o test
2
/10.Work:test> ./test
2
/10.Work:test_direction 255


So seems just different defaults. Strange through why differences have a place at all between platforms in such case.

Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project