i can get sprintf to work with an interger and %d in it but i cant get it to work with a string and %s in place of the %d. when the code hits that it just stops and never progresses past that point. why is this?
this works:
char buffer[80];
int current = 65;
void setup()
{
sprintf(buffer, "number = %d", current);
delay(2000);
Ethernet.begin(mac, ip);
Serial.begin(9600);
Serial.println(buffer);
sprintf does not have an overload that takes a String object. So, it is the address that gets passed to the function, which it can't convert to a string.
Why are you trying to use sprintf for string manipulation anyway?
String out = "Some bs up front " + current;
Serial.println(out);
On closer inspection, the documentation included with Ardiuno 021 is inconsistent with the implementation. The documentation on the web site appears to match the implementation. http://arduino.cc/en/Reference/StringToCharArray