摘要: #include int main() { int m,n,i,j,k; printf("Enter no. of elements in array1:\n"); scanf("%d",&m); int arr[m]; printf("Enter array elements:\n"); for(i=0;i<m;i++) scanf("%d",&arr[i]); printf("En... 阅读全文
posted @ 2018-11-08 17:53 anobscureretreat 阅读(1513) 评论(0) 推荐(0)
摘要: https://blog.csdn.net/ttt301/article/details/52326067 https://blog.csdn.net/longyanbuhui/article/details/71404308 阅读全文
posted @ 2018-11-08 01:47 anobscureretreat 阅读(14900) 评论(0) 推荐(1)
摘要: 昨天学习三种继承方式,有些比喻十分形象,特此分享。 首先说明几个术语: 1.基类 基类比起它的继承类是个更加抽象的概念,所描述的范围更大。所以可以看到有些抽象类,他们设计出来就是作为基类所存在的(有些名字里面有abstract的)。 基类也叫父类,虽然本人觉得这个比喻并不恰当。因为实际上子类是基类的 阅读全文
posted @ 2018-11-08 00:51 anobscureretreat 阅读(267) 评论(0) 推荐(0)
摘要: 以下代码会报错 修改的代码 由于,继承后,编译器不清楚setWeight函数是哪个类的,所以报错了,修改后,我们调用的就是实例化的那个类的函数,所以不会报错 阅读全文
posted @ 2018-11-08 00:07 anobscureretreat 阅读(415) 评论(0) 推荐(0)