
Originally Posted by
franco.amato
A last question: how the compiler know if is a C++ or C struct?
If you use a C++ compiler then every struct is a class for it. In other words in C++ there is no difference between a class and a struct, you can even do this (although msvc issues a warning for it):
// class, private by default:
class SomeClass; // forward declare in header file
// struct, public by default:
struct SomeClass {
//...
}; // define in implementation file
// class, private by default:
class SomeClass; // forward declare in header file
// struct, public by default:
struct SomeClass {
//...
}; // define in implementation file
To copy to clipboard, switch view to plain text mode
Bookmarks