[ create a new paste ] login | about

Link: http://codepad.org/vlvY5Pgb    [ raw code | output | fork ]

C++, pasted on Jun 7:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
void blah(const char* )       {printf("const char*\n");}
void blah(char[2] )       {printf("char 2\n");}
void blah(char[4] )       {printf("char 4\n");}
void blah(const std::string&) {printf("const string ref\n");}
template<class t>
void blah(t)                  {printf ("unknown\n");}

int main(int, char*)
{        
  blah("hi");
  char a[4];
  blah(&a[0]);
  blah(a);
  std::string s;
  blah(s);
}


Output:
1
2
3
In function 'void blah(char*)':
Line 3: error: redefinition of 'void blah(char*)'
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: