C代码:
#include <windows.h> #pragma comment(lib, "kernel32.lib") int start() { TCHAR message[] = TEXT("Taylor Swift\r\n泰勒·斯威夫特"); DWORD toWrite = sizeof(message) - sizeof(TCHAR); DWORD written; HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE); if (hStdOut != INVALID_HANDLE_VALUE && hStdOut != NULL) { WriteFile(hStdOut, message, toWrite, &written, NULL); } return 0; }
使用/c进行编译
使用/entry:start /subsystem:console进行链接
时间: 2024-12-29 11:15:34