How to convert __int64 to bool in C

2 Answers

0 votes
#include <stdio.h> 
#include <stdbool.h>
 
int main(void) 
{ 
    __int64 i64 = 1;
    bool b = i64 != 0;
     
    printf("%i\n", b);
     
    return 0; 
} 
   
   
   
/*
run:
   
1
 
*/

 



answered Aug 10, 2019 by avibootz
0 votes
#include <stdio.h> 
#include <stdbool.h>
 
int main(void) 
{ 
    __int64 i64 = 1;
    bool b = i64 != 0;
     
    printf(b ? "true" : "false");
     
    return 0; 
} 
   
   
   
/*
run:
   
true
 
*/

 



answered Aug 10, 2019 by avibootz

Related questions

1 answer 112 views
1 answer 170 views
2 answers 114 views
1 answer 141 views
141 views asked Apr 10, 2022 by avibootz
1 answer 206 views
206 views asked Aug 11, 2019 by avibootz
1 answer 225 views
225 views asked Aug 11, 2019 by avibootz
2 answers 259 views
259 views asked Aug 11, 2019 by avibootz
...