Home Stretch! :)
I'm nearly finished working out all the bugs out of my WordLinker. There is just one problem left.
[php]
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;
}
[/php]
Some how link[linkcount] is being passed a pointer to temp[i] when what I want is the value to be stored in memory that won't disappear...
I might be able to figure it out myself.... =/
[php]
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;
}
[/php]
Some how link[linkcount] is being passed a pointer to temp[i] when what I want is the value to be stored in memory that won't disappear...
I might be able to figure it out myself.... =/

