C++ new 学习笔记

摘要: 在C++中使用new和delete来替换C中的malloc和free new 实现一维指针: 1 int * P; 2 P = new int; //开辟一个存放整数的空间,并返回一个存储空间的地址(即指针); 3 * P = 5; 4 5 int * P = new int(5); //与上相等 阅读全文
posted @ 2021-10-26 18:59 CharonVan 阅读(89) 评论(0) 推荐(0)

C语言数据结构(实验一)基于顺序表的图书馆系统

摘要: 代码如下: #define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include <stdlib.h> #include<string.h> #include <algorithm> using namespace std;//排序函数 #define 阅读全文
posted @ 2021-10-26 15:04 CharonVan 阅读(2496) 评论(0) 推荐(0)