Преобразование в строку

Простые типы / Логический тип

bool sunIsStar = true;

// the first method: pick a word
const char *strSun = sunIsStar ? "true" : "false";
//strSun is "true"

// the second method: a number, printf has no bool format
bool earthIsStar = false;
char strEarth[8];
snprintf(strEarth, sizeof strEarth, "%d", earthIsStar);
//strEarth is "0"

printf("strSun is %s\n", strSun);
printf("strEarth is %s\n", strEarth);