2020年2月23日
摘要: 摘自https://www.cnblogs.com/ranjiewen/articles/6833074.html 阅读全文
posted @ 2020-02-23 21:28 一介布衣123 阅读(102) 评论(0) 推荐(0)
  2020年2月22日
摘要: 在C语言中,可以用字符数组和字符指针实现一个字符串。 例1: void main(){ char *string = "I am a student";//字符指针实现字符串 printf("%s\n",string);} 例2: #include <stdio.h>#include <string 阅读全文
posted @ 2020-02-22 22:15 一介布衣123 阅读(195) 评论(0) 推荐(0)
  2020年2月21日
摘要: 代码如下: #include <stdio.h> void convert(int n){int i;if ((i = n / 10) != 0)convert(i);putchar(n%10+'0');} void main(void){int number=13;printf("输入整数:"); 阅读全文
posted @ 2020-02-21 22:19 一介布衣123 阅读(462) 评论(0) 推荐(0)
摘要: sizeof与strlen是有着本质的区别,sizeof是求数据类型所占的空间大小,而strlen是求字符串的长度,字符串以/0结尾。 sizeof是一个C语言中的一个关键字,求的是数据类型所占空间的大小,而strlen是一个函数,用来计算字符串的长度,遇见/0就结束。 #include <stdi 阅读全文
posted @ 2020-02-21 21:48 一介布衣123 阅读(455) 评论(0) 推荐(0)
  2020年2月20日
摘要: #include<stdio.h>void main(){ int a = 10; int b =0; b=a++; printf("a=%d\n", a); printf("b=%d\n", b);} 运行结果: a=11 b=10 //////////////////////////////// 阅读全文
posted @ 2020-02-20 21:12 一介布衣123 阅读(2130) 评论(0) 推荐(0)