class A{
public:
static void abc();
};
// -------// A.cc //------//
#include <iostream>
using namespace std;
#include "A.h"
void A::abc(){
cout<<"abc"<<endl;
}
// -------// A.cc //------//
#include <iostream>
using namespace std;
#include "A.h"
A b;
int main(){
A::abc();
b.abc();
}
Compile as:
g++ main.cc A.cc
./a.out
No comments:
Post a Comment