#include <iostream>
#include "First.h" void Test(); int main()
{
std::cerr<<"Error,Hello!"<<std::endl; void (*p_Function)(void)=&Test;
for(size_t i=;i<sizeof p_Function;i++)
printf("%d",reinterpret_cast<char *>(&p_Function)[i]); std::cout<<"\n"; First first1,first2;
void (First::*p_Function_First_1)(void)=&First::Start;
void (First::*p_Function_First_2)(void)=&First::Start;
std::cout<<"First One:"<<std::endl;
for(size_t i=;i<sizeof(p_Function_First_1);i++)
printf("%d",reinterpret_cast<char *>(&p_Function_First_1)[i]);
std::cout<<"\n";
std::cout<<"First Two:"<<std::endl;
for(size_t i=;i<sizeof p_Function_First_2;i++)
printf("%d",reinterpret_cast<char *>(&p_Function_First_2)[i]); getchar();
return ;
}
反映的是:
Each new object you create contains storage for its own internal variables, the class members.
But all objects of the same class share the same set of class methods, with just one copy of each
method.