使用printf函数输出字符串:
#include <stdio.h>int main() { char str[] = "Hello, World!"; printf("%s\n", str); return 0;}使用puts函数输出字符串:#include <stdio.h>int main() { char str[] = "Hello, World!"; puts(str); return 0;}使用fputs函数输出字符串到指定文件流:#include <stdio.h>int main() { char str[] = "Hello, World!"; FILE *file = fopen("output.txt", "w"); fputs(str, file); fclose(file); return 0;}使用putchar函数逐字符输出字符串:#include <stdio.h>int main() { char str[] = "Hello, World!"; int i = 0; while (str[i] != '\0') { putchar(str[i]); i++; } putchar('\n'); return 0;} 

