Error: you can not convert 'String' to 'const char *' for argument '2' in 'int s

Hello,

I have this code that sends a URL through the ethernet port of the arduino, the URL
What you should send is this: http://192.168.10.1/api/control?color=46091&buzzer=0,
the variable color and buzzer change constantly, when I assign the values
to the variables and then to the URL, it sends me this error:

you can not convert 'String' to 'const char *' for argument '2' in 'int sprintf (char *, const char *, ...)'

Code:

String ADCData, Station, getData, Link;
int adcvalue=14608;  
ADCData = String(adcvalue);  
int station=0;
Station = String(station);
 
  
getData = "?color=" + ADCData + "&buzzer=" + Station ;
Link = "/api/control" + getData;
sprintf(pageAdd,Link,totalCount);

Regards.

the error occurs in sprintf

No. The error is in your code. The sprintf() function does NOT take a String. Stop trying to give it one.

The second argument to sprintf() is a format string, with format specifiers. The sprintf() function converts the variables supplied to string based on the format specifiers. Your format string contains no format specifiers.

Maybe this sprintf() reference will help.