
知识点回顾
fwq_qwert
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
【C面试题2】
考点一:const使用时的注意点 #include int main() { const int x = 1; int b = 10; int c = 20; const int *a1 = &b; int *const a2 = &b; const int * const a3 = &b; x = 2; // (错) const int x -------》原创 2018-01-30 16:32:01 · 173 阅读 · 0 评论 -
【C面试题1】
考点1:宏函数的连接 #include #define STR(s) #s //将s变为字符串 #define CONS(a,b) (int)(a##e##b) // 将参数abe连接成一个整型值 int main() { printf(STR(vck)); // "vck" printf("\n"); prin原创 2018-01-30 10:40:37 · 173 阅读 · 0 评论 -
【c++继承与派生】
继承的访问权限: 派生类 public : 公有继承 基类 public 成员:在派生类中还是 public 属性,在派生类的内部和外部都可以访问 基类 protected 成员:在派生类中还是 protected 属性,在派生类的内部可以访问, 外部不可以访问 基类 private 成员:在派生类中还是 private原创 2018-01-26 13:37:42 · 168 阅读 · 0 评论 -
【面试题5】
考点:参数引用的常见错误 #include using namespace std; class Test { public: void f(const int & arg); private: int value; }; void Test ::f(const int & arg) { arg = 10; // arg 是 const int 型的原创 2018-02-01 16:20:30 · 153 阅读 · 0 评论 -
【面试题4】
考点一:sizeof 计算虚继承类对象的空间大小 #include using namespace std; class A {}; class B {}; class C : public A,public B {}; class D:virtual public A {}; class E:virtual public A,virtual pu原创 2018-01-31 22:06:00 · 951 阅读 · 0 评论 -
【面试题3】
考点一:sizeof 计算普通变量所占空间大小 #include #include void func(char str[100]) { printf("4 %d\n",sizeof(str)); } int main() { char str[] = "hello"; char *p = str; int n = 10; printf("1 %d\n",s原创 2018-01-31 19:41:42 · 250 阅读 · 0 评论 -
【指针数组和数组指针的使用】
看程序写输出: #include int main () { char *str[] = {"welcome","to","Fortemedia","Nanjing"}; char **p = str+1; // p指向 to; str[0] = (*p++)+2;原创 2018-01-24 11:34:33 · 277 阅读 · 0 评论 -
【数组与指针的区别】
数组指针和指针数组的区别 数组指针(也称行指针) 定义 int (*p)[n]; ()优先级高,首先说明p是一个指针,指向一个整型的一维数组,这个一维数组的长度是n,也可以说是p的步长。也就是说执行p+1时,p要跨过n个整型数据的长度。 如要将二维数组赋给一指针,应这样赋值: int a[3][4]; int (*p)[4]; //该语句是定义一个数组指针,指向含4转载 2018-01-30 16:33:12 · 205 阅读 · 0 评论