what does this code mean?

hey everyone! just a quick Q! what does this code do?

void Adafruit_Thermal::writeBytes(uint8_t a) {
  
  stream->write(a);

}

specifically this line

stream->write(a);

Search "C++ arrow operator"

Or try a Google search on;

Arduino ->

but how common is it to define a function as part of a structure? i often do this as a short cut to avoid defining a C++ class.

ALAA72: specifically this line

stream->write(a);

It's similar to Serial.write() but stream is a lower level class - it is used by Serial.

...R

gcjr: but how common is it to define a function as part of a structure? i often do this as a short cut to avoid defining a C++ class.

In C++, struct and class are identical except for the default access modifier. It's 'public' for struct and 'private' for class.