Same name function can be declared infinite times

 

 

-----------------------------------ah.h-------------------

void setb();
void setb();

void setb();

void setb();

void setb();

void setb();

void setb();

 

 

------------------ah.cpp----------------

#include"ah.h"

#include<iostream>

using namespace std;

void setb()

{  int b=1;  cout<<"call setb()"<<"b="<<endl; }

 

-------------------calla.cpp------------

 

#include"ah.h"

void setb();

 void seta()

{    setb(); }

 

 

 

-----------------------------main.cpp--------------

#include"ah.h"

#include<iostream>

extern void seta();

void setb();

void setb();

using namespace std;

void main()

{  setb();  seta(); }  

posted @ 2016-06-03 19:36  steven_xiu  阅读(138)  评论(0编辑  收藏  举报