Hello everyone!
Maybe my questions are too trivial. I want to have all my classes for a project in an external file.
-
Why do you always find the
extern lol LOL; // myFun.h
in examples on the internet? It seems to work without it. -
Why does the class “lol” in the .ino-File not appear yellow?
-
lol LOL=lol(); // Auslagern.ino
creates an instance of the class lol right? Do I need to create instances of every used class in the .ino-File or can this be done in the specific .cpp file?
Thank you for answers, best
Sam–
// Auslagern.ino
//
#include <MyFun.h>
lol LOL=lol();
void setup(){
}
void loop(){
LOL.test();
}
// MyFun.h
//
#ifndef MyFun_h
#define MyFun_h
class lol {
public:
void test(void);
};
extern lol LOL;
#endif
//MyFun.cpp
//
#include <MyFun.h>
void lol::test(void){
}