I was wondering if someone could help I am getting these error message and I can't figure out how to fix them any ideas??
error C2228: left of '.string' must have class/struct/union type
C:\Documents and Settings\Owner\My Documents\Computer error C2664: 'lin_search' : cannot convert parameter 1 from 'class index [2000]' to 'class index *[]'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
here is my code
I call the function like this:Code:class index{ public: int number; char string[100]; char url[50]; }; bool lin_search(index *l[], char word[]){ for(int i = 0; i <= 20; i++) if(l[i].string == word) return true; return false; }
I hope someone can help. ThanksCode:index w[2000]; char word[100]; int count = 0; ifstream filein("collection.txt", ios::nocreate); while(!addrin.eof()){ addrin >> word; if(lin_search(w, word) == true){}



LinkBack URL
About LinkBacks


