I would like someone to explain me the “name::name” syntax and how it is used on C++ programming. I have been looking through but I don’t get it yet. Thanks for help.
Here is context code:
void UsbProSender::SendMessageHeader(byte label, int size) const {
Serial.write(0x7E);
Serial.write(label);
Serial.write(size);
Serial.write(size >> 8);
}
::is the scope resolution operator.std::coutis the namecoutin the namespacestd.std::vector::push_backis the push_back method of std::vector.In your code example:
UsbProSender::SendMessageHeaderis providing the definition for theSendMessageHeadermethod of theUsbProSenderclass.Another (more complete) example: