This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#include <stdio.h>
#include <unistd.h>
int main() {
const char *msg = "Hello, world!\n";
// 使用 write 系统调用向标准输出(文件描述符 1)写入数据
ssize_t result = write(1, msg, 14);
if (result == -1) {
perror("write failed");
return 1;
}
printf("Successfully wrote %zd bytes.\n", result);
return 0;