Hi,
Mình viết code bên dưới để check 1 file đang được open hay đang closed
Không biết sai chỗ nào mà lúc nào cũng in ra là: File is open. :(
Code:fstream strFile;
strFile.open( "text.txt" );
if( strFile.is_open() ){
printf("File is open.\n");
strFile.close();
}
else{
printf("File is close.\n");
}