Search
 
SCRIPT & CODE EXAMPLE
 

C

format bool c

// there is no way of pretty-print a boolean with printf
printf("%i", true);  // will print 1
printf("%i", false); // will print 0

// but we can create a macro
#define formatBool(b) ((b) ? "true" : "false")
printf("%s", formatBool(true));  // will print true
printf("%s", formatBool(false)); // will print false
Comment

PREVIOUS NEXT
Code Example
C :: how to sleep in c 
C :: c/c++ type format 
C :: c assign pointer to struct 
C :: read from a file c 
C :: how to login to another user in powershell 
C :: c static variables 
C :: why do we need return 0 in c? 
C :: string input c 
C :: turn a char into an int in c 
C :: downgrade chrome to previous stable version in linux 
C :: Hello world in C programming language 
C :: c int 
C :: extract substring after certain character in flutter 
C :: c int to char 
C :: get float in c 
C :: c read file content 
C :: convert c program to assembly language online 
C :: c pointers 
C :: fibonacci series in c 
C :: selection sort c 
C :: Installing Tailwind 
C :: #define f_cpu 
C :: create point cloud from rgbd image in open3d v0.10 
C :: c structure with pointer 
C :: c read binary file 
C :: scopes in c 
C :: unused variable in c 
C :: hostbuilder add environment variables 
C :: float da 4 byte 
C :: C Operator associativity 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =