JZTXT
  • 首页
  • Ai
  • Java
  • Python
  • Android
  • Mysql
  • JavaScript
  • Html
  • CSS

learn c++ 智能指针

发布时间 2023-05-22 00:31:42作者: AngDH

 

 

#include <iostream>


int main() {

    int* p;


    {
        std::unique_ptr<int[]> a{std::make_unique<int[]>(50)};

        a[2] = 240;

        p = a.get();
        std::cout << p[2];
    
    }
    std::cout << "\n";

    std::cout << p[2];

}

 

    本栏目推荐文章
  • C++ --- 智能指针
  • 智能电网中的安全数据聚合方案
  • 《RAPL: A Relation-Aware Prototype Learning Approach for Few-Shot Document-Level Relation Extraction》阅读笔记
  • 【五期李伟平】CCF-A(AAAI'21)Game of Gradients: Mitigating Irrelevant Clients in Federated Learning
  • 深入浅出 C 语言:学变量、掌控流程、玩指针,全方位掌握 C 编程技能
  • 【C语言】指针
  • TVBox等智能电视第三方APP可用直播源接口【截止24.01.12】
  • 快慢指针解决环形链表
  • TSINGSEE青犀视频智能分析网关V4烟火检测算法解决方案
  • TSINGSEE青犀智能分析网关V4:搭建智慧幼儿园视频AI智能监管方案
版权声明:本网站为非赢利性站点,本网站所有内容均来源于互联网相关站点自动搜索采集信息,相关链接已经注明来源。
联系我们