私は在庫ファイルをフォーマットするための小さなユーティリティを書いていますので、既存のデータベースにインポートすることができます。私はfscanfをやろうとする大きな問題を抱えています。私は過去数十万のファイルを読んできました。私はここで間違って何をしていますか?fopen()の問題
クリストファーの提案に基づく編集はまだNULLになっています。
#include <stdio.h>
#include <string.h>
int main()
{
FILE* stream;
FILE* output;
char sellercode[200];
char asin[15];
string sku[15];
string fnsku[15];
int quality;
stream = fopen("c:\out\dataextract.txt", "r");
output = fopen("c:\out\output.txt", "w");
if (stream == NULL)
{
return 0;
}
for(;;)
{
//if (EOF) break;
fscanf(stream, "%s", sku);
fprintf(output, "%s %s %s %s %i\n", sku, fnsku, asin, quality);
}
return 0;
}
'char *文字列のtypedef;'また、あなたは(関数fscanfを使用しているように見えるC. –