Chinaunix首页 | 论坛 | 博客
  • 博客访问: 597582
  • 博文数量: 239
  • 博客积分: 7941
  • 博客等级: 准将
  • 技术积分: 2467
  • 用 户 组: 普通用户
  • 注册时间: 2010-07-10 12:14
个人简介

及时当勉励

文章分类

全部博文(239)

文章存档

2013年(29)

2011年(22)

2010年(188)

分类:

2011-01-11 19:14:02

// ===============================================
//
//       Filename:  Array.h
//
//    Description:  
//
//        Version:  1.0
//        Created:  2011年01月10日 04时14分23秒
//       Revision:  none
//       Compiler:  g++
//
//         Author:  贾献华 (GNU_hua), jiaxianhua@gmail.com
//        Company:  hisoft
//
// ===============================================


#ifndef  ARRAY_H__INC
#define  ARRAY_H__INC

class Array {
    public:
        Array(int size = INIT_SIZE, int cur_size = 0);
        Array(const Array& other);
        Array& operator=(const Array& other);
        ~Array();

        int get_size() const;
        int get_cur_size() const;
        int get_value(const int& index) const;

        Array& resize();
        void insert(const int& index, const int& value);
        void append(const int& value);
        void clear();
        void print_Array();
        void for_each(void* (*op)(const int&, const int&));
    private:
        const static int INIT_SIZE = 128;
        int _size;
        int _cur_size;
        int *element;
};


#endif   // ----- #ifndef ARRAY_H__INC  -----

阅读(1107) | 评论(0) | 转发(0) |
0

上一篇:Makefile__Array

下一篇:ArrayPtr.h______Array

给主人留下些什么吧!~~