|
-
April 17th, 2009, 09:16 PM
#1
Not displaying anything
Hey everyone I am new to this forum. I have a quite puzzling question, I am working on a piece of code that'll take words from a word list and cout them on the screen. I uploaded the file and everything I am using strtok and its using the \n as its delimiters.
Heres the code-- It did doesn't "cout" anything. Thanks
#include <iostream>
#include <string>
using namespace std;
int func(char * filePath);
int main()
{
char intake[1024] = {'NULL'};
cout << "Enter in path of the file.\n";
cin >> intake;
func(intake);
return 0;
}
int func(char * filePath)
{
FILE * pFile;
char * x;
pFile = fopen(filePath, "r");
while (pFile != NULL)
{
x = strtok(filePath, "\n");
cout << x;
}
return 0;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|