Convert Sint16 to int ?
I'd like to convert sint16 (short int 16-bits) to int.
Or otherwise, I'd like to compare sint16 with int
Cuz no functions support these operands
You can just cast it:
1 2
|
short a = 10;
int b = (int)a;
|
If it is for a function:
1 2 3 4 5 6 7 8
|
void Function(int a);
int main()
{
short x = 10;
Function((int)x);
return 0;
}
|
Last edited on
Topic archived. No new replies allowed.