Có thư viện nào mà mở file không có thì tạo file mà không làm tác dụng phụ khác không?
#include <vector>
#include <iostream>
#include<stdlib.h>
#include<malloc.h>
#include<stdio.h>
#include<fstream>
#include<cstdio>
using namespace std;
typedef vector<int> intArray;
void main() {
#if 0
int i, m, n;
vector<intArray> a;
cout << "Nhap so luong dong, cot: "<<"\n\n";
cout<<"Nhap so luong dong : ";
cin>>m;
cout<<"Nhap so luong cot : ";
cin>>n;
a.resize(m);//resize là thay đổi kích thước mảng
for (i = 0; i < m; i++)
a[i].resize(n);
#endif
ifstream f;
f.open("D:\hoangkiet1.txt",ios::app);
if (f == NULL)
printf("Khong mo duoc tap tin!\n\n");
else
{
cout<<"mo duoc tap tin!"<<"\n\n";
}
f.read("D:\input.txt", 10);
//free(p);
system("pause");
}