说到输出首先就想到了printf函数,例如:数组
char *p="123456789";
printf("123456789");
printf("%s","123456789");
printf(p);
那有没有其余方法呢,我查阅了一些资料。ide
好比用fputs函数函数
fputs(p,stdout);
这样也能够在屏幕上打印出123456789spa
用puts函数指针
puts(p);
能够打印出123456789而且自动换行。orm
函数资料:字符串
对于ANSI C 程序,运行时系统会打开至少三个流,这3个流包括:input
1. 标准输入 standard input . 标准定义为stdin.it
2 标准输出 standard output. 标准定义为stdoutclass
3. 标准错误 standard error. 标准定义为stderr.
fputs(...)用于向这三个流写入数据。
因此fputs(p,stdout)能够输出字符串,p能够为数组名,字符指针或字符串常量。
puts()函数用来向标准输出设备(屏幕)写字符串并换行,其调用方式为,puts(p);其中p能够为数组名,字符指针或字符串常量。