با این کد ساده میتونید محتوای فایل رو با سی پلاس بخونید که خیلی از دانش آموزان و دانشجوها سوال میشه.

//this example opens a file called myfile.txt
//and reads the text message to it
#include <fstream.h> 
int main()
{
ifstream MyFile("myfile.txt");
char ch;

while(!MyFile.eof())
{
MyFile.get (ch);
cout<<ch;
}
MyFile.close();
return 0;
}
آخرین ویرایش: 09-03-2020 ???? 11:12، توسط رضا رمضانپور