عايز اكتر من صف من الملف انا دلوقتى عرفت اقرأ الملف بس كل اللى بقدر اعمله انى اقرأ اول صف بس
و لو حطيت أرقام مبقدرش أقرأها .
#include <iostream>
#include <stdio.h>
using namespace std;
int main(){
FILE *file;
// Write in a file
file = fopen("C:\\matrix.txt","w");
fprintf (file,"welcome\n to \nc++");
fclose (file);
// Read a file
char fileContent[100]; // Buffer
file = fopen("C:\\matrix.txt","r");
fgets(fileContent, 100, file);
fclose(file);
printf("%s\n",fileContent); // Print file contents
return 0;
}