voidprint(constint& a){cout << a << endl;}intmain(){constint num =50;//局部constint* p =const_cast<int*>(&num);//使用const_cast<>强制将const属性去掉*p =20;//通过指针修改内容print(num);return0;}
classDraw{public:virtual~Draw(){}virtualvoiddrawLen()=0;};classCircle:publicDraw{private:double radius;public:Circle(double r):radius(r){}~Circle(){printf("%s%f\n","Delete circle with radius ",radius);}voidgetDescription(){printf("%s%f\n","Circle with radius ",radius);}voiddrawLen(){printf("%s%f\n","Circle with len ",2*3.14* radius);}};intmain(){Draw* d =newCircle(5);//基类指针指向子类对象d->drawLen();Circle* c =dynamic_cast<Circle*>(d);//将基类指针转子类指针if(c!=nullptr) c->getDescription();//访问子类特有的成员函数delete d;return0;}
技术笔记! 一、初识STM32
1.1 ARM内核系列
A 系列:Application缩写。高性能应用,比如:手机、电脑、电视等。 R 系列:Real-time缩写。实时性强,汽车电子、军工、无线基带等。 M 系列:Microcont…
dmesg介绍
dmesg工具用途: dmesg - print or control the kernel ring buffer kernel ring buffer, 内核环形缓冲区,也叫环形队列,Linux内核日志就存储在一个环形队列中,环形队列满的时候,新的消息会覆盖掉旧的消息。…
本文首发于公众号:机器感知
PTQ4SAM、Mamba-Attention、AniTalker、IceFormer、U-DiTs、CogDPM PTQ4SAM: Post-Training Quantization for Segment Anything Segment Anything Model (SAM) has achieved impressive performance in many computer vision tasks. Ho…
CyberDemo: Augmenting Simulated Human Demonstration for Real-World Dexterous Manipulation解读 摘要1. 简介2. Related Work2.1 Data for Learning Robot Manipulation2.2 机器人的预训练视觉表征2.3 Sim2Real Transfer 3. CyberDemo3.1 收集人体遥操作数据3.2 在模拟器中…