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 116 views
1 answer 176 views
2 answers 124 views
1 answer 153 views
153 views asked Apr 10, 2022 by avibootz
1 answer 209 views
209 views asked Aug 11, 2019 by avibootz
1 answer 233 views
233 views asked Aug 11, 2019 by avibootz
2 answers 267 views
267 views asked Aug 11, 2019 by avibootz
...