is that a class, an object, and instance, or all three?
It could be any or none of them depending what is contained in the files and how they are used
Can you give a real example ?
A .h file does not call a .cpp file, so maybe it is one of the above or none of the above.
There's no hard and fast rule. But, typically, the .h file contains the class's interface -- i.e. the information you need to use it. The .cpp file contains the class's implementation -- the guts. The application code uses the information in the .h file to instantiate objects of the class.
so what would the main program be called in the real c++ world? Obviously not .ino Evidently that is arduino only.
So is it fair to say that when I see #include <ESP8266WiFi.h> that that piece will have all the variables that my .ino will be sending.
I think I am really just trying to understand where to look when i get compiler errors as we al do.
so what would the main program be called in the real c++ world?
The main function is called main and could be in any .CPP file.
When you say class I think of it as a template or data definition like in COBOL. first ten bytes are number, next twenty are name, etc.
Then you have instance. Is instance just the same template filled in with data specific to the calling program?
I still don't know where object fits in. And please don't say just read up, I have and for some reason it isn't gelling.
A class is an outline of a set of related data and functions, a little like "int" is a datatype, but doesn't define an actual variable. The class defines the methods available, but doesn't create an object.
An object is an actual instance of a class.
Oh, so a class INCLUDES functions. I did not know that. Well, that brought out the goosebumps. Well now maybe that will help with the understanding. So something that has the data structures and functions is a class.
I have been thinking of the #include stuff as like drivers, as in if you want to drive this dht, you get the include file in your library etc.
So is "creating an instance" something you can think of as adding a driver to your program?
It's called encapsulation. The class (or struct) is supposedly self-contained. The public methods and data members are accessible to all, and the private methods and data members are only available to other members. Normally, you would keep data members private, to ensure consistency.
The only difference between a struct and a class is that, in a class, members are private by default, but in a struct, they are public.
It's finally starting to make some sense, thank you, you have been a great help.
When I worked as a programmer back after the earth cooled, it wasn't like this. You had online, CICS, and batch stuff to run at night when online was offline.
That's only a greatly simplified view - there's all sorts of complexity.
You had online, CICS, and batch stuff to run at night when online was offline.
Completely unrelated concepts