#ifndef CAT_H #define CAT_H struct Cat { void meow(); }; #endif
And then you implement meow() in Cat.cpp:
#include "Cat.h" #include <iostream> void Cat::meow() { std::cout << "meow" << std::endl; }
Then in main.cpp you can call meow():
#include "Cat.h" int main() { Cat cat; cat.meow(); }
To compile this you can run:
g++ main.cpp Cat.cpp