摘要:
#include<stdio.h>struct name{ char *name; char n; int age; char *sex; char *ss;}stduent;int main(){ stduent.age=10; stduent.name="弘一"; stduent.sex="男" 阅读全文
posted @ 2022-03-10 08:48
眰恦01
阅读(52)
评论(0)
推荐(0)
摘要:
#include<iostream>#include<string>class Lkuy{ public: Lkuy(std::string name,int a){ this->a=a; this->name=name; } virtual void print();//虚函数(动态绑定); in 阅读全文
posted @ 2022-03-08 22:13
眰恦01
阅读(57)
评论(0)
推荐(0)
摘要:
C++中的多态是通过虚函数来实现的。 只有通过积累的指针或引用来调用虚函数,才会对被调用的函数进行动态绑定。 阅读全文
posted @ 2022-03-07 12:30
眰恦01
阅读(32)
评论(0)
推荐(0)
摘要:
#include<iostream>#include<string>class Time{ public: void kiss(Time *m); Time(std::string name,int a,int b){ this->name=name; this->a=a; this->b=b; } 阅读全文
posted @ 2022-03-03 23:00
眰恦01
阅读(77)
评论(0)
推荐(0)
摘要:
#include<iostream>int main(){ int i; int j; int a[][3]={{1},{2}}; for(int i=0;i<=2;i++){ for(int j=0;j<=2;j++){ std::cout<<a[i][j]; } std::cout<<"\n"; 阅读全文
posted @ 2022-03-01 12:00
眰恦01
阅读(40)
评论(0)
推荐(0)
浙公网安备 33010602011771号