Go Down

Topic: Overloaded function with no contextual type information (Read 1 time) previous topic - next topic


I had a search through the forum relating to this problem, and couldn't find anything, I'm using sprintf to write a string to twitter but the code wont compile due to the error in the title, below is the offending bit of code

sprintf(msg, "Tanktweet bootup time: %s:%s", hour, minute);

I want to ensure my tweets are unique hence the addition of the time, I actually wanted to add day, month and year too but thought I should run before I could walk :-)

If I use

sprintf(msg, "Tanktweet bootup time: %lu", now);

it works but tweets difficult to read number, "704185874" for example.

What am I missing I was trying to work out what the difference between %s %d and %lu are as I have seen them all used.

Thanks for the help



That we are missing is the code and the error message!.



The error is in the Title and this is the line of code causing it but I just managed to answer my own question :-)

The corrected code

  sprintf(msg, "Tanktweet bootup time: %d:%d  %d/%d/%d", hour(), minute(),day(), month(), year());

Thought I'd post the solution too :-)


Go Up