c---数据类型强制转换

#include <stdio.h>

int main()
{
    int a=0,b=320;
    short s=0;
    //数据强制转换的格式:(类型)值 
    a=(int)102.3;  //把浮点数转换成int
    printf("%d
",a);
    s=(short)b;  //把int转换成short 
        
    return 0;
}

数据类型强制转换的优先级高于四则运算

原文地址:https://www.cnblogs.com/liming19680104/p/13337225.html