在C++中,用于打开文件并追加写入的语句是( )
fopen("data.txt", "r")
ofstream file("data.txt", ios::app)
ifstream file("data.txt")
fstream file("data.txt", ios::out)