Created
June 12, 2023 11:51
-
-
Save guangxuanliu/2ba286a38ec05518131ab4944997ffcc to your computer and use it in GitHub Desktop.
以追加模式写日志文件,指针
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <sstream> | |
#include <fstream> | |
using namespace std; | |
int main() | |
{ | |
std::ofstream outfile; | |
outfile.open("example.txt", std::ios_base::app); // 以追加模式打开文件 | |
int* p = new int(15); | |
cout << std::hex << p << endl; | |
outfile << std::hex << p << std::endl; | |
outfile.close(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment