How does one ignore a void value?
hey there everybody,
i've been working parallax rfid reader/writer got
it's super awesome, , can read data fine, want try write it. decided write function (hooray me!) can't work - error keep getting follows:
rfid.cpp: in function 'void do_rfid_write(char*)':
rfid:125: error: void value not ignored ought be
rfid:128: error: void value not ignored ought be
here's code write function, , can include rest of code if anyone's interested. how can test see if void, , ignore if so?
i've been working parallax rfid reader/writer got
it's super awesome, , can read data fine, want try write it. decided write function (hooray me!) can't work - error keep getting follows:rfid.cpp: in function 'void do_rfid_write(char*)':
rfid:125: error: void value not ignored ought be
rfid:128: error: void value not ignored ought be
here's code write function, , can include rest of code if anyone's interested. how can test see if void, , ignore if so?
quote
void do_rfid_write(char indata[]){
for(int = 0; < sizeof(indata)/sizeof(char) && < maxaddress*4; i++){
sendwritecommand(i/4); // because can store 4 chars (or bytes) per address
while(!myserial.available()){
}
statuscode = myserial.print(indata); // <- line 125, fails first
while(statuscode != err_ok){
sendwritecommand(i);
statuscode = myserial.print(indata); // <- fails second
}
serial.print("wrote address ");
serial.println(i);
}
serial.println("finished write");
}
code: [select]
statuscode = myserial.print(indata[i]);myserial.print() not return value. can't assign return code function not return value variable.
code: [select]
while(statuscode != err_ok){
sendwritecommand(i);
statuscode = myserial.print(indata[i]); // <- fails second
}this makes no sense. since myserial.print() not return value, value (doesn't) return can not possibly err_ok. or, else matter.
to answer original question, 1 "ignores" nothing not trying save it.
Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > How does one ignore a void value?
arduino
Comments
Post a Comment