Im new to c and could use some help.
I am trying to output a text file using the fputs command, however I need to input a complete string to the fputs function which i dont have. I have about 6 arrays and I want to put the [i] th entry of each array into the string that is used in the fputs function.
There is one arry of characters and multiple arrays of ints and floats.
at the moment i have my various arrays and i am trying to make all of the [i]th into one array which i can send to the fputs function
eg the string I need has : {array1[i] array2[i] array3[i] etc…}
Any help would be greatly appreciated.
EDIT: clarity
complier errors:
assignment from incompatible pointer types
passing argument one of fputs from incompatible pointer type.
You are looking for
sprintf().If you have too many
array[], you can use a for loop then usestrcpyandstrcatto make the finalbufwhich you can use infputs.