Contact: aviboots(AT)netvision.net.il
41,301 questions
53,811 answers
573 users
#include <stdio.h> #include <stdbool.h> #include <string.h> int main(void) { char *pch = "false"; bool b = pch && stricmp(pch, "true") == 0; fputs(b ? "true" : "false", stdout); return 0; } /* run: false */
#include <stdio.h> #include <stdbool.h> #include <stdlib.h> int main(void) { char *pch = "1"; bool b = (char)atoi(pch); fputs(b ? "true" : "false", stdout); return 0; } /* run: true */