Trying to print a union to get a 8X2 LCD to work as 16X1

I’m pretty new to arduino, and my coding knowledge is pretty basic.
But i’ve been trying out a few things over the last week.
My problem is, because the 16X1 LCD screen i have is wired as a 8X2 i was trying to find a way to print to it with out moving the cursor. I was trying to use a union. here is the code i was using:

#include <LiquidCrystal.h>


LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  
  Serial.begin(9600);
   
  lcd.begin(8, 2);
  
}            
void loop() 
{
 int sensor = analogRead(A0);
 int voltage = sensor * (5000 / 1023);
 Serial.println(voltage);
 
 union twoWords
  {
   uint8_t split[2][8];
   char both[17];
  }
  doubleText;
  strcpy ( doubleText.both, "Voltage: %d", voltage);
  
  lcd.setCursor(0, 0);
  lcd.write (doubleText.split[0],8);
  lcd.setCursor(0, 1);
  lcd.write ((char*)doubleText.split[1]);
 
 

}

But when i try to compile the sketch it gives me the error:
too many arguments to function ‘char* strcpy(char*, const char*)’
JoinWord:48: error: at this point in file.

I’m not sure if my question is very clear, but any help would be very appreciated. Thanks.

  strcpy ( doubleText.both, "Voltage: %d", voltage);

The strcpy() function takes two arguments - where the copy the data and the data to copy. Why are you passing it three?

It looks like you mean to be using sprintf(), not strcpy().

Yes that worked.. To be honest now its makes alot more sense to me.. simple mistake.

Thanks a million