structures and object oriented programming help

I have scoured the Arduino reference and lots of c plus plus tutorials

but..l cannot find a simple discussion how to use data structures and C plus plus objects with the class. Xxx format/notation or whatever

help would be appreciated

An object is an instance of a class. The only significant difference between a class and a structure is that for a structure the default aces is public, but for a class it's private.

AWOL:
An object is an instance of a class.
The only significant difference between a class and a structure is that for a structure the default aces is public, but for a class it’s private.

…plus a class can have member functions but a structure can’t.

However, I cannot fathom any meaning from your question. What is it you actually want to know / do? What is “Xxx format/notation or whatever”?

In short: what…?

The arduino documentation doesn’t include many standard C/C++ features, because they’re considered beyond the scope of what a normal arduino user would be expected to want to understand. But it IS a standard C/C++ compiler underneath, so you can just refer to standard references for C/C++. Though you WILL have to take into account limitations imposed by the “very small” nature of the destination processor, the lack of some standard C++ runtime and template libraries, and stuff like that.

Do you have a more specific question? For instance, using “Serial.print()” is “using a data structure with the Class.xxx notation.”

...plus a class can have member functions but a structure can't.

Sure it can. A C struct can't, but a C++ struct can.

PaulS:

...plus a class can have member functions but a structure can't.

Sure it can. A C struct can't, but a C++ struct can.

Oooh, so it can - you learn something new every day.

I wonder... can you put a member function inside a union...?

yes

Not meaning to pinch the thread, but this seems inline and a bit more substantial compared to ‘yes’.

Unions are objects just the same as classes and structs. To provide an insight as to where a member function may be useful in a union this example uses a conversion operator to provide an alternative to supporting the Printable base class. It will serialize anything using a union.

Then you can print or write it to anything supporting the print library.

template< typename T >
  union Serialize{
    T Obj;
    byte Data[ sizeof( T ) ];
    
    operator byte*(){ return this->Data; }
    operator char*(){ return ( char* ) this->Data; }
    size_t size() { return sizeof( T ); }
};

struct UnPrintable{
  int a, b, c, d, e, f, g;
};

void setup() {
  
  Serial.begin( 9600 );
  
  UnPrintable u = { 'ba', 'dc', 'fe', 'hg', 'ji', 'lk', '\0m'  };

  Serialize< UnPrintable > s = { u };
  
  Serial.println( s ); //Look it prints.
  
  //Or if there is no null at the end.
  Serial.write( s, s.size() );
}

void loop() {}

As unions allow initializing the first member, you can remove the duplicated memory and just use the union.

Serialize< UnPrintable > s = {{ 'ba', 'dc', 'fe', 'hg', 'ji', 'lk', '\0m'  }};