zoukankan      html  css  js  c++  java
  • shell-数组

    1. 定义数组
        数组名=(元素1 元素2 元素3 ...)
    2. 查看数组
        declare -a
    3. 访问数组元素
        ${arr[0]}   访问某一个元素
        ${#arr[@]}  访问所有元素
        ${!arr[@]}  访问所有下标
        ${arr[@]:2}  访问下标2开始的所有元素
        ${arr[@]:2:2}  访问下标2开始的后两个元素
        
    
    When nothing seems to help, I go look at a stonecutter hammering away at his rock, perhaps a hundred times without as much as a crack showing in it. Yet at the hundred and first blow it will split in two, and I know it was not that blow that did it, but all that had gone before. -- Jacob Riis
  • 相关阅读:
    STL常用容器☞String容器
    初识STL
    函数模板
    多态
    运算符重载
    友元
    对象的初始化和清理
    C++内存分区模型
    传值和传地址
    const的使用
  • 原文地址:https://www.cnblogs.com/xhwy-1234/p/12114777.html
Copyright © 2011-2022 走看看