c语言程序设计必背代码.docxVIP

  • 8
  • 0
  • 约2.05千字
  • 约 5页
  • 2023-04-06 发布于浙江
  • 举报
c语言程序设计必背代码 以下是部分常见的C语言程序设计必背代码: 1. 输出函数:printf() 函数原型:int printf(const char *format, ...) 用法举例:printf(Hello world!\n); 2. 输入函数:scanf() 函数原型:int scanf(const char *format, ...) 用法举例:scanf(%d, a); 3. 文件操作函数:fopen()、fclose()、fread()、fwrite() 函数原型: - FILE* fopen(const char *filename, const char *mode); - int fclose(FILE *stream); - size_t fread(void *ptr, size_t size, size_t count, FILE *stream); - size_t fwrite(const void *ptr, size_t size, size_t count, FILE *stream); 用法举例: FILE *fp; fp = fopen(filename.txt, r); fclose(fp); 4. 字符串操作函数:strcpy()、strcat()、strlen()、strcmp() 函数原型: - char

文档评论(0)

1亿VIP精品文档

相关文档