Answer the question
In order to leave comments, you need to log in
How to output TCHAR to a file?
There is a local computer name obtained in this section of code:
string LOCALHOST;
TCHAR HOSTNAME[UNLEN+1];
DWORD HOSTNAME_LEN = UNLEN+1;
LOCALHOST = GetComputerName((TCHAR*)HOSTNAME,&HOSTNAME_LEN);
string log_path = "log.txt";
ofstream log;
log.open(log_path, ofstream::app);
log << "Имя узла:" << endl;
log << LOCALHOST << endl;
log.close();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question