
C++
Insist_bin
这个作者很懒,什么都没留下…
展开
-
指针数组与数组指针
1、指针数组:是指一个数组里面装着指针,也即指针数组是一个数组定义形式:int *a[10];2、数组指针:是指一个指向数组的指针,它其实还是一个指针,只不过是指向数组而已;定义形式:int (*p)[10]; 其中,由于[]的优先级高于*,所以必须添加(*p)区分方法:主要看后面的两个字是什么(前面是修饰作用),因此指针数组是数组,而数组指针是指针。...原创 2021-03-07 15:47:50 · 2372 阅读 · 0 评论 -
C++:输入一个十进制数表示的正整数,将其转换为二进制表示并输出结果
#include <iostream>using std::cout;using std::cin;using std::endl;void fun(int num) { if (num > 1) { fun(num/2); cout << num % 2; } else { cout << num; }}void binary(int num) { int i = 0, temp = num; int arr[32]; w.原创 2020-12-19 20:19:04 · 6620 阅读 · 1 评论