Sorry... that's the whole class:
[php]
class Word
{
int maxlinks;
char* wordname;
char* links;
int linkcount;
public:
Word(char str[]){strcpy(wordname, str);}
Word(){
maxlinks = 1000;
links = new char[maxlinks];
strcpy(links, "");
wordname = "";
linkcount = 0;
}
void newWord(char* str)
{
wordname =(char*)str;
}
char* getWord(){return wordname;}
void addDirLink(char* str)
{
char temp[50] = "";
strcpy(temp, str);
for(int i = 0; temp[i]; i++)
{
linkcount++;
//here is the problem
//Somehow its passing a pointer to temp[i]
//rather then the value....
//I already have memory allocated all I need is the value... not a pointer
links[linkcount] = temp[i];
}
linkcount++;
links[linkcount] = ' ';
}
char* getLinks()
{
cout<<"What is links? " << links[0] <<endl;
return links; //here getLinks returns nothing! D;
}
};
[/php]