- 论坛徽章:
- 0
|
#include<iostream>;
#include<fstream>;
using namespace std;
int main()
{
fstream fin;
char *no1;
char seps[] = " ,\t\n";
char *token;
char *str;
cin>;>;no1;
fin.open(no1);
token = strtok(fin, seps); //此处应该怎样进行类型转换,还是不能这样做?
while(token != NULL)
{
/* While there are tokens in "string" */
printf( " %s\n", token );
/* Get next token: */
token = strtok( NULL, seps );
}
return 0;
}
error C2664: 'strtok' : cannot convert parameter 1 from 'class std::basic_fstream<char,struct std::char_traits<char>; >;' to 'char *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
您好, 编译的时候出现这个错误,我是新手,不知道这儿应该怎样处理, 谢谢 |
|