I want to format some text from different variables to use as an argument for a function that is expecting char * as an input. I am drawing a blank. I have tried casting and different printf combinations, but I am not arriving at a solution.
As an example:
I have Hour and Minutes which are bytes, and Seconds which is a float, and I want to put it together as an input to a char *
But this doesn't work:
someFunction(0,0,printf("%i:%i:%2.3",H,M,S));
The error I am getting is:
invalid conversion from int to char*. I have determined it's not a datatype in the printf, but rather the "result" of printf?
As I said, I have tried casting it "(char *)" in front of "printf" which compiled, but doesn't give the expected result. I know I'm missing the obvious, I just can't see it
Any help would be appreciated, thanks