خرید بک لینک

Vote count: 0

How many type conversion are there in the following code:

#include<stdio.h>
int f(int x)
{
    retu (float)x;
}
int main()
{
    float x = f(5L);
    retu 0;
}

In function f(), the retu value is promoted from int to float. In main(), the argument of f() is promoted from int to long, and int is again promoted to float.

Is it correct that there are three type conversions (promotions)?

asked 39 secs ago

- - , .
.

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 22 تير 1395 ساعت: 1:54

صفحه بندی