A
aaragon
Hi All,
I'm trying to print boolean values and after I searched the entire web,
I couldn't find anything that does this =/ The code that I ended up
using is as follows:
string boolString(Object* obj_, size_t maxOutput_){
string string_;
for (size_t i=0; i<maxOutput_; i++){
if( sizeof(obj_->boolean(i)) == sizeof(bool) ){
if (obj_->boolean(i) == true)
string_ += "1";
else
string_ += "0";
}
}
return string_;
}
Is there any way to simplify this code?
I'm trying to print boolean values and after I searched the entire web,
I couldn't find anything that does this =/ The code that I ended up
using is as follows:
string boolString(Object* obj_, size_t maxOutput_){
string string_;
for (size_t i=0; i<maxOutput_; i++){
if( sizeof(obj_->boolean(i)) == sizeof(bool) ){
if (obj_->boolean(i) == true)
string_ += "1";
else
string_ += "0";
}
}
return string_;
}
Is there any way to simplify this code?