blob: 95aa6b49db0a25f4e93cf987a7cdd5d8f5fd102f [file] [log] [blame]
#include "variadicBool.h"
int numberOfTrues(int count, va_list arguments) {
int i, total;
total = 0;
for(i = 0; i < count; i++) {
//we're passing int here because passing bool is actually incorrect since
//bool is actually promoted to int in C
if(va_arg(arguments, int) == true) {
total += 1;
}
}
return total;
}