LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

how to pass array into sprintf


for(a=0;a<65;a++){
Name[a]=bytess[a];
}


sprintf (msg, "Name: %c ", Name[0]);
WriteLine (iFile, msg, -1);

 

 

in sprintf am only recieving one integer,how to get all 64 bytes in msg,i have to disply name in single line

0 Kudos
Message 1 of 2
(4,404 Views)

Hello, this is a very basiq question about C language: %c means a single character, while the entire string (up to the first NUL character, of course) requires %s.

 

If you have problems at this level yshould consider reading some C manual or at least googling some informations: this is one of the first pages on sprintf that could have clarified your doubts.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 2
(4,401 Views)