前提
CでWindowsのコンソールアプリを作っていたところ、エラーが出たので、そのことについて。
実現したいこと
- エラーが出ないようにしたいです
発生している問題・エラーメッセージ
該当のソースコード
C
1#include <stdio.h> 2#include <conio.h> 3#include <stdlib.h> 4#include <string.h> 5#include <strings.h> 6 7int main(void){ 8 printf("condole settion started!\n"); 9 getch(); 10 FILE *fn; 11 fn = fopen("C:/gcc/Project/data.dtbs", "r"); 12 if(fn = NULL){ 13 printf("ERROR:CANNOT OPEN THE FILE:C:/gcc/Project/data.dtbs"); 14 exit(0); 15 } 16 char ch[4336620]; 17 int cnt = 0; 18 while( (ch[cnt] = fgetc(fn)) != EOF){ 19 cnt++; 20 } 21 char *str_start; 22 str_start = strstr(ch, "<p class=\"weather-telop\">"); 23 printf("DeBug:%s", str_start); 24 25 getch(); 26 fclose(fn); 27 return 0; 28}
補足情報(FW/ツールのバージョンなど)
Windows 10 Pro 32bit
Virtual Studio Code 1.67.2
> エラーが出ないようにしたいです
で、質問としては、なにを求めていますか?
「回答者は問題を解決したコードを示せ」ということですか?
回答3件
あなたの回答
tips
プレビュー