Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By SupDoc
#81021 I setup the code as follows:
#include <stdio.h>

char buffer[50];
char* s = "geeksforgeeks";

void setup() {
Serial.begin(115200);

// Counting the character and storing
// in buffer using snprintf
int j = snprintf(buffer, 14, "%s\n", s);

// Print the string stored in buffer and
// character count
printf("string:\n%s\ncharacter count = %d\n", buffer, j);

// return 0;
}

void loop()
{

}
and what I got in the serial monitor:
string:
but I got no buffer contents! Any idea what happened to the buffer contents?