Re: Not displaying anything
Re: Not displaying anything
Are you sure it didn't output anything? Maybe it did but it exited before you saw it.
Re: Not displaying anything
I just ran your program and this is what printed.
Code:
Enter in path of the file.
F:/Html/htmlfiles/graphics3.htm /* <-- I entered a file path */
F:/Html/htmlfiles/graphics3.htmF:/Html/htmlfiles/graphics3.htmF:/Html/htmlfiles/graphics3.htm
F:/Html/htmlfiles/graphics3.htmF:/Html/htmlfiles/graphics3.htmF:/Html/htmlfiles/graphics3.htm
F:/Html/htmlfiles/graphics3.htmF:/Html/htmlfiles/graphics3.htmF:/Html/htmlfiles/graphics3.htm
/* Infinite loop that continues to print the file path. I only let it run for 20 seconds. */
I am not sure if i typed the filepath correctly or not? But the infinite loop doesnt seem right.
Re: Not displaying anything
You misused strtok. strtok takes a string and a delimiter. It read filePath as a string. I suggest you use fgets and fputs in cstdio.
Re: Not displaying anything
Code:
char intake[1024] = {'NULL'};
What are you trying to do there?
and here?
Code:
while (pFile != NULL)
{
x = strtok(filePath, "\n");
cout << x;
}
There's nothing there that will change the value of pFile.