aboutsummaryrefslogtreecommitdiffstats
path: root/leetcode/2469/main.c
blob: 0ea6e06ab242408eb9a3245babd510ff4eece888 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
/**
 * Note: The returned array must be malloced, assume caller calls free().
 */
double* convertTemperature(double celsius, int* returnSize) {
    *returnSize = 2;
    double* rtn = malloc(sizeof(double) * *returnSize);
    rtn[0] = celsius + 273.15;
    rtn[1] = celsius * 1.80 + 32.00;

    return rtn;
}