在c语言程序中,printf能用作变量名吗?..asdadafdsgf
3条回答 默认 最新
a5156520 2024-01-16 19:32关注printf是可以用做变量名的,不过不建议这样做,因为可能导致一些混淆和错误。
测试代码如下:
参考链接:write函数的详解与read函数的详解-CSDN博客 文章浏览阅读7w次,点赞28次,收藏129次。write()头文件:#include<unistd.h>原型:ssize_t write(int fd,const void*buf,size_t count);参数说明: fd:是文件描述符(write所对应的是写,即就是1) buf:通常是一个字符串,需要写入的字符串 count:是每次写入的字节数返回值: 成功:返回写入的字节数..._write函数的详解与read函数的详解https://blog.csdn.net/dangzhangjing97/article/details/79619894
#include <unistd.h> #include <string.h> int main(void){ // https://blog.csdn.net/dangzhangjing97/article/details/79619894 const char * printf = "Hello World!"; int len = strlen(printf); write(1,printf,len); char buf[1024]={0}; read(0,buf,len); return 0; }
解决 无用评论 打赏 举报 编辑记录