NPC.h
#ifndef NPC_H
#define NPC_H
#include <string>
class NPC
{
public:
//構造函數
NPC();
//析構函數
~NPC();
protected:
};
#endif
NPC.cpp
#include "npc.h"
#include <iostream>
//構造函數
NPC::NPC(){
std::cout<<"初始化。。。"<<std::endl;
}
//析構函數
NPC::~NPC(){
std::cout<<"結束。。。"<<std::endl;
}
main.cpp
#include <iostream>
#include "NPC.h"
int main(int argc, char** argv) {
NPC npc;
return 0;
}
調試截圖: