123456789101112131415161718
#include <cstdlib> #include <iostream> #include "test.h" using namespace std; int main(int argc, char *argv[]) { Test test; test.testfunc(); system("PAUSE"); return EXIT_SUCCESS; }
12345678910111213
#include <iostream> #include "test.h" // class's header file using namespace std; void testfunc() { cout << "Hello World." << endl; }
12345678910
#ifndef TEST_H #define TEST_H class Test { public: void testfunc(); }; #endif // TEST_H