Typedef enum

Rboolean is an enumerated type for boolean variables. The symbolic constants defined by this enumerated type are: FALSE (= 0) and TRUE (= 1).

Declaration

typedef enum { FALSE = 0, TRUE /*, MAYBE */ } Rboolean;

In Boolean.h.

Examples

rboolean <- inline::cfunction(NULL, ' Rboolean false_x = FALSE; Rboolean true_x = TRUE; Rprintf("Rboolean FALSE is: %d\\n", false_x); Rprintf("Rboolean TRUE is: %d\\n", true_x); return R_NilValue; ' Rboolean false_x = FALSE; Rboolean true_x = TRUE; Rprintf("Rboolean FALSE is: %d\\n", false_x); Rprintf("Rboolean TRUE is: %d\\n", true_x); return R_NilValue; ') invisible(rboolean())
#> Rboolean FALSE is: 0 #> Rboolean TRUE is: 1