• 大小: 0.09M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-02-21
  • 标签: 动态  数组  

资源简介

c 数组的基本操作

资源截图

代码片段和文件信息

//2020-3-26
//yyz

#include 
#include “Array.h“
#include “Student.h“

void demo1();
void demo2();

using namespace std;

int main()
{
    demo1();
    return 0;
}
void demo2()
{
    Array arr = Array(20);
    arr.addLast(Student(“Alice“100));
    arr.addLast(Student(“Bob“66));
    arr.addLast(Student(“Ming“88));
    arr.print();
}


void demo1()
{

    Array arr1 = Array();
    /*int a = arr1.getSize();
    int b = arr1.getCapacity();
    cout<< a << “ “<< b <
    for (int i = 0; i < 10; ++i)
    {
        arr1.addLast(i);
    }
    arr1.print();

    arr1.addFirst(-1);
    arr1.print();
    arr1.addLast(100);
    arr1.print();
    arr1.add(30);
    arr1.print();
/*    a = arr1.getSize();
    b = arr1.getCapacity();
    cout<< a << “ “<< b <
    arr1.print();
    cout<< “arr1[12]= “ <    arr1.set(0999);
    arr1.print();

    arr1.removeLast();
    arr1.print();
    arr1.remove(5);
    arr1.print();
    a

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        4076  2020-03-27 20:54  Array.h
     目录           0  2020-04-19 16:19  __MACOSX\
     文件         176  2020-03-27 20:54  __MACOSX\._Array.h
     目录           0  2020-03-27 20:54  cmake-build-debug\
     文件       34076  2020-03-27 20:54  cmake-build-debug\02_Arrays
     文件        6604  2020-03-27 20:15  cmake-build-debug\02_Arrays.cbp
     文件        1456  2020-03-26 16:18  cmake-build-debug\cmake_install.cmake
     文件       39510  2020-03-26 16:18  cmake-build-debug\CMakeCache.txt
     目录           0  2020-03-27 21:07  cmake-build-debug\CMakeFiles\
     目录           0  2020-03-27 20:54  cmake-build-debug\CMakeFiles\02_Arrays.dir\
     文件        4592  2020-03-26 16:18  cmake-build-debug\CMakeFiles\02_Arrays.dir\build.make
     文件         250  2020-03-27 20:15  cmake-build-debug\CMakeFiles\02_Arrays.dir\cmake_clean.cmake
     文件         650  2020-03-27 20:54  cmake-build-debug\CMakeFiles\02_Arrays.dir\CXX.includecache
     文件         358  2020-03-27 20:54  cmake-build-debug\CMakeFiles\02_Arrays.dir\depend.internal
     文件         248  2020-03-27 20:54  cmake-build-debug\CMakeFiles\02_Arrays.dir\depend.make
     文件         665  2020-03-26 16:18  cmake-build-debug\CMakeFiles\02_Arrays.dir\DependInfo.cmake
     文件         231  2020-03-26 16:18  cmake-build-debug\CMakeFiles\02_Arrays.dir\flags.make
     文件         161  2020-03-26 16:18  cmake-build-debug\CMakeFiles\02_Arrays.dir\link.txt
     文件      117256  2020-03-27 20:54  cmake-build-debug\CMakeFiles\02_Arrays.dir\main.cpp.o
     文件          43  2020-03-27 20:15  cmake-build-debug\CMakeFiles\02_Arrays.dir\progress.make
     目录           0  2020-03-26 16:18  cmake-build-debug\CMakeFiles\3.15.3\
     文件        2469  2020-03-26 16:18  cmake-build-debug\CMakeFiles\3.15.3\CMakeCCompiler.cmake
     文件        5189  2020-03-26 16:18  cmake-build-debug\CMakeFiles\3.15.3\CMakeCXXCompiler.cmake
     文件        4304  2020-03-26 16:18  cmake-build-debug\CMakeFiles\3.15.3\CMakeDetermineCompilerABI_C.bin
     文件        4288  2020-03-26 16:18  cmake-build-debug\CMakeFiles\3.15.3\CMakeDetermineCompilerABI_CXX.bin
     文件         362  2020-03-26 16:18  cmake-build-debug\CMakeFiles\3.15.3\CMakeSystem.cmake
     目录           0  2020-03-26 16:18  cmake-build-debug\CMakeFiles\3.15.3\CompilerIdC\
     文件        8616  2020-03-26 16:18  cmake-build-debug\CMakeFiles\3.15.3\CompilerIdC\a.out
     文件       20099  2020-03-26 16:18  cmake-build-debug\CMakeFiles\3.15.3\CompilerIdC\CMakeCCompilerId.c
     目录           0  2020-03-26 16:18  cmake-build-debug\CMakeFiles\3.15.3\CompilerIdC\tmp\
     目录           0  2020-03-26 16:18  cmake-build-debug\CMakeFiles\3.15.3\CompilerIdCXX\
............此处省略20个文件信息

评论

共有 条评论