Created
November 1, 2012 21:55
-
-
Save andrewberls/3996896 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// hashtable.hpp | |
class HashTable { | |
public: | |
struct HashTable::HashEntry* insert(int); | |
struct HashEntry { | |
// Some stuff | |
}; | |
}; | |
// hashtable.cpp | |
struct HashTable::HashEntry* HashTable::insert(int item) { | |
// Do stuff | |
return &elements[0]; | |
} | |
// Compile Error: | |
// In file included from hashtable.cpp:2: | |
// hashtable.hpp:10: error: ‘HashEntry’ in class ‘HashTable’ does not name a type | |
// hashtable.cpp:19: error: prototype for ‘HashTable::HashEntry* HashTable::insert(int)’ does not match any in class ‘HashTable’ | |
// hashtable.hpp:10: error: candidate is: int* HashTable::insert(int) | |
// hashtable.cpp:19: error: ‘HashTable::HashEntry* HashTable::insert(int)’ cannot be overloaded | |
// hashtable.hpp:10: error: with ‘int* HashTable::insert(int)’ | |
// make: *** [hashtable.o] Error 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment