'Sprintf() cannot accept function parameter

I want to write a program like this to let sprintf() accept the function parameter

int x (char z) { //z is a character array
    float y = 10.254;
    sprintf (z, "%2.1f", y);
    printf ("%c", &z);
}

However when I enter the array as a parameter, nothing happens.

How can I let sprintf accept an external parameter



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source