c语言实现动态指针数组Dynamic arrays
c语言实现动态数组。其它c的数据结构实现,hashTable參考点击打开链接 treeStruct參考点击打开链接
基本原理:事先准备好一个固定长度的数组。
假设长度不够的时候。realloc一块区域。
另外:在数组元素降低的情况下。须要缩减数组长度。
主要接口:
cp_bool DyArrayAppend(DyArray* pArr, void* pData)//加数据到数组末尾
cp_bool DyArrayExpand(DyArray* pArr, cp_int32 nNeed)//扩展数组
cp_bool DyArrayDelete(DyArray* pArr, cp_int32 nIndex)//删除元素by index
cp_bool DyArrayShrink(DyArray* pArr)//缩减数组
源码例如以下:(iOS平台的c实现)
//
// dyArray.h
// dataStruct
//
// Created by hherima on 14-7-28.
// Copyright (c) 2014年 . All rights reserved.
// #ifndef dataStruct_dyArray_h
#define dataStruct_dyArray_h
#include <stdlib.h> enum
{
CP_FALSE = 0,
CP_TRUE = !CP_FALSE
}; typedef unsigned char cp_bool;
typedef signed int cp_int32;
typedef void (*DataDestroyFunc)(void *);
typedef cp_bool (*DataCmpFunc)(void *,void *);
typedef void (*DataVisitFunc)(void *); #define F_MALLOC_TYPE(s) (s*)f_malloc(sizeof(s))
#define FREEFUN free
#define MIN_PRE_ALLOCATE_SIZE 10 //The initial size of the dynamic array.
#define MEMSETFUN memset
#define REALLOCFUN realloc
#define MALLOCFUN malloc struct DynamicArray
{
void **m_ppData; //the address of the allocated array.
cp_int32 m_nAllocSize; //the allocated array size.
cp_int32 m_nSize; //the used size of the array.
DataDestroyFunc m_fDestroy; //the callback function to destroy one data.
DataCmpFunc m_fCmp; //the callback function to compare one data.
DataVisitFunc m_fVisit; //the callback function to visit each data.
};
typedef struct DynamicArray DyArray; DyArray* DyArrayCreate(DataDestroyFunc pDataDestroy);
cp_bool DyArrayInsert(DyArray* pArr, cp_int32 nIndex, void* pData);
cp_bool DyArrayPrepend(DyArray* pArr, void* pData);
cp_bool DyArrayAppend(DyArray* pArr, void* pData);
cp_bool DyArrayDelete(DyArray* pArr, cp_int32 nIndex);
cp_bool DyArrayDeleteEx(DyArray* pArr, cp_int32 nBegin,cp_int32 nEnd);
cp_bool DyArrayGetByIndex(DyArray* pArr, cp_int32 nIndex, void** ppData);
cp_bool DyArrayGetFirst(DyArray* pArr,void** ppData);
cp_bool DyArrayGetLast(DyArray* pArr,void** ppData);
cp_bool DyArraySetByIndex(DyArray* pArr, cp_int32 nIndex, void* pData);
cp_int32 DyArrayLength(DyArray* pArr);
cp_int32 DyArrayFind(DyArray* pArr, DataCmpFunc pCmp,void *pData);
cp_bool DyArrayForEach(DyArray* pArr, DataVisitFunc pVisit);
void DyArrayDestroy(DyArray* pArr);
void DyArrayDestroyCustom(DyArray* pArr,DataDestroyFunc pDataDestroy);
void DyArrayReset(DyArray* pArr);//shrink
void DyArrayClear(DyArray* pArr);//not shrink
void DyArrayResetCustom(DyArray* pArr,DataDestroyFunc pDataDestroy);
void DyArrayClearCustom(DyArray* pArr,DataDestroyFunc pDataDestroy);//not shrink #endif
//
// dyArray.c
// dataStruct
//
// Created by hherima on 14-7-28.
// Copyright (c) 2014年 . All rights reserved.
// #include "dyArray.h" void* f_malloc(cp_int32 size)
{
void* p = MALLOCFUN(size);
if(p)
MEMSETFUN(p, 0, size); return p;
}
/**************************************************************************************************
【函数名】: DyArrayCreate
【描写叙述】: 创建长度为MIN_PRE_ALLOCATE_SIZE的动态指针数组
【參数】:
pDataDestroy: the callback function to destroy one data in data array.
【返回值】: 动态指针数组的地址
***************************************************************************************************/ DyArray* DyArrayCreate(DataDestroyFunc pDataDestroy)
{
DyArray *pArr = NULL;
pArr = F_MALLOC_TYPE(DyArray); //if the input parameter is invalid, return.
if(!pArr)
{
return NULL;
}
//malloc memory for dynamic array and iniatilize it.
pArr->m_fDestroy = pDataDestroy;
pArr->m_ppData = (void *)f_malloc(sizeof(void *)*MIN_PRE_ALLOCATE_SIZE);
if(!pArr->m_ppData)
{
FREEFUN(pArr);
return NULL;
}
pArr->m_nAllocSize = MIN_PRE_ALLOCATE_SIZE;
return pArr;
} /**************************************************************************************************
【函数名】: DyArrayGetByIndex
【描写叙述】:获取数组元素by index
【參数】:
pArr: the array's address.
nIndex: the element's position.
ppData: out parameter, to record the element's pointer.
【返回值】: true or false.
***************************************************************************************************/ cp_bool DyArrayGetByIndex(DyArray* pArr, cp_int32 nIndex, void** ppData)
{
//if the input parameter is invalid, return.
if(!pArr || nIndex < 0 || !ppData || nIndex >= pArr->m_nSize)
{
*ppData = NULL;
return CP_FALSE;
}
*ppData = pArr->m_ppData[nIndex];//get the related element.
return CP_TRUE;
} /**************************************************************************************************
【函数名】: DyArrayGetFirst
【描写叙述】:获取数组第一个元素
【參数】:
pArr: the array's address.
ppData: out parameter, to record the element's pointer.
【返回值】: true or false.
***************************************************************************************************/ cp_bool DyArrayGetFirst(DyArray* pArr,void** ppData)
{
return DyArrayGetByIndex(pArr,0,ppData) ? CP_TRUE : CP_FALSE;
} /**************************************************************************************************
【函数名】: DyArrayGetLast
【描写叙述】: 获取数组最后一个元素
【參数】:
pArr: the array's address.
ppData: out parameter, to record the element's pointer.
【返回值】: true or false.
***************************************************************************************************/ cp_bool DyArrayGetLast(DyArray* pArr,void** ppData)
{
return DyArrayGetByIndex(pArr,pArr->m_nSize-1,ppData) ? CP_TRUE : CP_FALSE;
} /**************************************************************************************************
【函数名】:DyArraySetByIndex
【描写叙述】: 设置数组元素by index
【參数】:
pArr: the array's address.
nIndex: the element's position.
pData: the element's pointer.
【返回值】: true or false.
***************************************************************************************************/ cp_bool DyArraySetByIndex(DyArray* pArr, cp_int32 nIndex, void* pData)
{
//if the input parameter is invalid, return.
if(!pArr || nIndex < 0)
{
return CP_FALSE;
}
pArr->m_ppData[nIndex] = pData;//find the related position and set its value.
return CP_TRUE;
} /**************************************************************************************************
【函数名】: DyArrayLength
【描写叙述】:获取数组的长度
【參数】:
pArr: the array's address.
【返回值】: 数组长度.
***************************************************************************************************/ cp_int32 DyArrayLength(DyArray* pArr)
{
return pArr ? pArr->m_nSize : -1;
} /**************************************************************************************************
【函数名】: DyArrayFind
【描写叙述】:查找数组中的指定元素
【參数】:
pArr: the array's address.
pCmp: the callback function to compare the data.
pData: the search destination in the array.
【返回值】:假设成功返回位置,否则返回-1
***************************************************************************************************/ cp_int32 DyArrayFind(DyArray* pArr, DataCmpFunc pCmp,void *pData)
{
cp_int32 i; //if the input parameter is invalid, return.
if(!pArr)
{
return -1;
}
//visit each one to find the right one.
for(i=0; i<pArr->m_nSize;i++)
{
if(pCmp)
{
if(pCmp(pArr->m_ppData[i],pData) == CP_TRUE)
{
return i;
}
}else
{
//if NO compare funciton, just compare the address.
if(pArr->m_ppData[i] == pData)
{
return i;
}
} }
return -1;
} /**************************************************************************************************
【函数名】: DyArrayForEach
【描写叙述】:遍历数组
【參数】:
pArr: the array's address.
pVisit: the callback function to visit the data.
【返回值】:假设成功返回true,否则false
***************************************************************************************************/ cp_bool DyArrayForEach(DyArray* pArr, DataVisitFunc pVisit)
{
cp_int32 i; //if the input parameter is invalid, return.
if(!pArr || !pVisit)
{
return CP_FALSE;
}
//visit each one with the visit function.
for(i=0; i<pArr->m_nSize;i++)
{
pVisit(pArr->m_ppData[i]);
}
return CP_TRUE;
} /**************************************************************************************************
【函数名】: DyArrayDestroy
【描写叙述】:销毁整个数组
【參数】:
pArr: the array's address.
【返回值】:NA
***************************************************************************************************/ void DyArrayDestroy(DyArray* pArr)
{
cp_int32 i; //if the input parameter is invalid, return.
if(!pArr)
{
return;
}
//Using destroy function to destroy each element's memory.
if(pArr->m_fDestroy)
{
for(i=0; i<pArr->m_nSize; i++)
{
pArr->m_fDestroy(pArr->m_ppData[i]);
}
}
//free the array.
FREEFUN(pArr->m_ppData);
pArr->m_ppData = NULL;
FREEFUN(pArr);
pArr = NULL;
} /**************************************************************************************************
【函数名】: DyArrayDestroyCustom
【描写叙述】:使用用户函数。小围数组
【參数】:
pArr: the array's address.
pDataDestroy: user's destroy function.
【返回值】:NA
***************************************************************************************************/ void DyArrayDestroyCustom(DyArray* pArr,DataDestroyFunc pDataDestroy)
{
cp_int32 i; //if the input parameter is invalid, return.
if(!pArr)
{
return;
}
//Using destroy function to destroy each element's memory.
if(pDataDestroy)
{
for(i=0; i<pArr->m_nSize;i++)
{
pDataDestroy(pArr->m_ppData[i]);
}
}
//free the array.
FREEFUN(pArr->m_ppData);
pArr->m_ppData = NULL;
FREEFUN(pArr);
} /**************************************************************************************************
【函数名】: DyArrayExpand
【描写叙述】:扩展数组
【參数】:
pArr: the array's address.
nNeed: the needed new size.
【返回值】:假设成功返回ture否则返回false
***************************************************************************************************/ cp_bool DyArrayExpand(DyArray* pArr, cp_int32 nNeed)
{
cp_int32 allocSize = 0;
void** data = NULL; //if the input parameter is invalid, return.
if(!pArr)
{
return CP_FALSE;
}
//if need, expand to 1.5 times of the original size.
if((pArr->m_nSize + nNeed) > pArr->m_nAllocSize)
{
allocSize = pArr->m_nAllocSize + (pArr->m_nAllocSize>>1);
data = (void**)REALLOCFUN(pArr->m_ppData, sizeof(void*) * allocSize);
if(data != NULL)
{
//clear the expanded space of the new memory.
MEMSETFUN(data+pArr->m_nAllocSize,0,(allocSize-pArr->m_nAllocSize)*sizeof(void*));
pArr->m_ppData = data;
pArr->m_nAllocSize = allocSize;
}
}
return ((pArr->m_nSize + nNeed) <= pArr->m_nAllocSize) ? CP_TRUE : CP_FALSE;
} /**************************************************************************************************
【函数名】: DyArrayInsert
【描写叙述】:插入数组by index
【參数】:
pArr: the array's address.
nIndex: the position in the array to insert new data.
pData: the data to be inserted.
【返回值】:假设成功返回true否则false
***************************************************************************************************/ cp_bool DyArrayInsert(DyArray* pArr, cp_int32 nIndex, void* pData)
{
cp_bool bRet = CP_FALSE;
cp_int32 nCursor = nIndex;
cp_int32 i; //if the input parameter is invalid, return.
if(!pArr)
{
return CP_FALSE;
}
//get the right cursor.
nCursor = nCursor < pArr->m_nSize ? nCursor : pArr->m_nSize;
if(DyArrayExpand(pArr, 1) == CP_TRUE)
{
//move all the elements after the cursor to the next positon.
for(i = pArr->m_nSize; i > nCursor; i--)
{
pArr->m_ppData[i] = pArr->m_ppData[i-1];
}
//set the cursor's value.
pArr->m_ppData[nCursor] = pData;
pArr->m_nSize++;
bRet = CP_TRUE;
}
return bRet;
} /**************************************************************************************************
【函数名】: DyArrayPrepend
【描写叙述】:在数组開始加入一个数据
【參数】:
pArr: the array's address.
pData: the data to be added.
【返回值】:假设成功返回ture,否则false
***************************************************************************************************/ cp_bool DyArrayPrepend(DyArray* pArr, void* pData)
{
return DyArrayInsert(pArr,0,pData) ? CP_TRUE:CP_FALSE;
} /**************************************************************************************************
【函数名】: DyArrayAppend
【描写叙述】:加入数据到数组末尾
【參数】:
pArr: the array's address.
pData: the data to be added.
【返回值】:假设成功返回true。否则false
***************************************************************************************************/ cp_bool DyArrayAppend(DyArray* pArr, void* pData)
{
return DyArrayInsert(pArr,pArr->m_nSize,pData) ? CP_TRUE:CP_FALSE;
} /**************************************************************************************************
【函数名】: DyArrayShrink
【描写叙述】:缩减数组
【參数】:
pArr: the array's address.
【返回值】:ture 或者false
***************************************************************************************************/ cp_bool DyArrayShrink(DyArray* pArr)
{
cp_int32 nAllocSize = 0;
void** pData = NULL; //if the input 【參数】 is invalid, return.
if(!pArr)
{
return CP_FALSE;
}
//if need, shrink the array to 1.5 times of elements number.
if((pArr->m_nSize < (pArr->m_nAllocSize >> 1)) && (pArr->m_nAllocSize > MIN_PRE_ALLOCATE_SIZE))
{
nAllocSize = pArr->m_nSize + (pArr->m_nSize >> 1);
pData = (void**)REALLOCFUN(pArr->m_ppData, sizeof(void*) * nAllocSize);
if(pData != NULL)
{
//clear memory of the unused space of new memory.
MEMSETFUN(pData+pArr->m_nSize,0,(nAllocSize-pArr->m_nSize)*sizeof(void*));
pArr->m_ppData = pData;
pArr->m_nAllocSize = nAllocSize;
}
}
return CP_TRUE;
} /**************************************************************************************************
【函数名】: DyArrayDelete
【描写叙述】:删除元素by index
【參数】:
pArr: the array's address.
nIndex: the position in the array to delete useless data.
【返回值】:ture 或者false
***************************************************************************************************/ cp_bool DyArrayDelete(DyArray* pArr, cp_int32 nIndex)
{
cp_int32 i; //if the input parameter is invalid, return.
if(!pArr)
{
return CP_FALSE;
}
//destroy the element with destroy function.
if(pArr->m_fDestroy)
{
pArr->m_fDestroy(pArr->m_ppData[nIndex]);
}
//move the elements after 'nIndex' to the previous one.
for(i = nIndex; (i+1) < pArr->m_nSize; i++)
{
pArr->m_ppData[i] = pArr->m_ppData[i+1];
}
//set the last one to null.
pArr->m_ppData[i] = NULL;
pArr->m_nSize--;
//if need ,shrink the size.
DyArrayShrink(pArr);
return CP_TRUE;
}
/**************************************************************************************************
【函数名】: DyArrayDeleteEx
【描写叙述】:删除元素by index (扩展)
【參数】:
pArr: the array's address.
nIndex: the position in the array to delete useless data.
nEdn:
【返回值】:ture 或者false
***************************************************************************************************/ cp_bool DyArrayDeleteEx(DyArray* pArr, cp_int32 nBegin,cp_int32 nEnd)
{
cp_int32 i,nLen = 0; //if the input parameter is invalid, return.
//if(!pArr && nBegin>nEnd && nBegin<0 && nBegin>=pArr->m_nSize && nEnd<0 && nEnd>=pArr->m_nSize)
if(!pArr)
{
return CP_FALSE;
}
//destroy the element with destroy function.
if(pArr->m_fDestroy)
{
for(i=nBegin; i<=nEnd; i++)
{
pArr->m_fDestroy(pArr->m_ppData[i]);
}
}
//move the elements after 'nIndex' to the previous one.
nLen = nEnd - nBegin + 1;
for(i = nBegin; (i+nLen) < pArr->m_nSize; i++)
{
pArr->m_ppData[i] = pArr->m_ppData[i+nLen];
}
//set the last one to null.
//pArr->m_ppData[i] = NULL;
pArr->m_nSize -= nLen;
//if need ,shrink the size.
DyArrayShrink(pArr);
return CP_TRUE;
} /**************************************************************************************************
【函数名】: DyArrayReset
【描写叙述】:清除数组数据,缩减数组到原始大小
【參数】:
pArr: the array's address.
【返回值】:
none.
***************************************************************************************************/ void DyArrayReset(DyArray* pArr)
{
cp_int32 i;
void** pData = NULL; //if the input parameter is invalid, return.
if(!pArr)
{
return;
}
//reset all the elements with destroy function.
if(pArr->m_fDestroy)
{
for(i=0; i<pArr->m_nSize;i++)
{
pArr->m_fDestroy(pArr->m_ppData[i]);
}
}
pArr->m_nSize = 0;
//if need, shrink the size.
if(pArr->m_nAllocSize > MIN_PRE_ALLOCATE_SIZE)
{
pData = (void**)REALLOCFUN(pArr->m_ppData, sizeof(void*) * MIN_PRE_ALLOCATE_SIZE);
if(pData != NULL)
{
pArr->m_ppData = pData;
pArr->m_nAllocSize = MIN_PRE_ALLOCATE_SIZE;
}
if(pArr->m_ppData)
{
MEMSETFUN(pArr->m_ppData,0,sizeof(void*)*pArr->m_nAllocSize);
}
}
}
/**************************************************************************************************
【函数名】: DyArrayClear
【描写叙述】:清除数组数据。不缩减数组到原始大小
【參数】:
pArr: the array's address.
【返回值】:NA
***************************************************************************************************/ void DyArrayClear(DyArray* pArr)
{
cp_int32 i;
void** pData = NULL; //if the input parameter is invalid, return.
if(!pArr)
{
return;
}
//reset all the elements with destroy function.
if(pArr->m_fDestroy)
{
for(i=0; i<pArr->m_nSize;i++)
{
pArr->m_fDestroy(pArr->m_ppData[i]);
}
}
pArr->m_nSize = 0;
} /**************************************************************************************************
【函数名】: DyArrayResetCustom
【描写叙述】:清除数组使用用户函数,缩减数组到原始大小
【參数】:
pArr: the array's address.
pDataDestroy: user's destroy function.
【返回值】:NA
***************************************************************************************************/ void DyArrayResetCustom(DyArray* pArr,DataDestroyFunc pDataDestroy)
{
cp_int32 i;
void** pData = NULL; //if the input parameter is invalid, return.
if(!pArr)
{
return;
}
//reset all the elements with destroy function.
if(pDataDestroy)
{
for(i=0; i<pArr->m_nSize;i++)
{
pDataDestroy(pArr->m_ppData[i]);
}
}
pArr->m_nSize = 0;
//if need, shrink the size.
if(pArr->m_nAllocSize > MIN_PRE_ALLOCATE_SIZE)
{
pData = (void**)REALLOCFUN(pArr->m_ppData, sizeof(void*) * MIN_PRE_ALLOCATE_SIZE);
if(pData != NULL)
{
pArr->m_ppData = pData;
pArr->m_nAllocSize = MIN_PRE_ALLOCATE_SIZE;
}
if(pArr->m_ppData)
{
MEMSETFUN(pArr->m_ppData,0,sizeof(void*)*pArr->m_nAllocSize);
}
}
}
/**************************************************************************************************
【函数名】: DyArrayClearCustom
【描写叙述】:清除数组使用用户函数,不缩减数组到原始大小
【參数】:
pArr: the array's address.
pDataDestroy: user's destroy function.
【返回值】:NA
***************************************************************************************************/ void DyArrayClearCustom(DyArray* pArr,DataDestroyFunc pDataDestroy)
{
cp_int32 i;
void** pData = NULL; //if the input parameter is invalid, return.
if(!pArr)
{
return;
}
//reset all the elements with destroy function.
if(pDataDestroy)
{
for(i=0; i<pArr->m_nSize;i++)
{
pDataDestroy(pArr->m_ppData[i]);
}
}
pArr->m_nSize = 0; }
c语言实现动态指针数组Dynamic arrays的更多相关文章
- C语言中的指针数组
C语言中的指针数组是什么,像 char *a[]={"ddd","dsidd","lll"}; 这里讲一下注意如果我们使用了a也就是首元素的 ...
- C语言中的指针数组和数组指针
代码: #include <iostream> using namespace std; int main(){ ]; ]; cout<<sizeof(a)<<en ...
- C语言的函数指针数组(好绕啊~看完这篇估计就通关了)
转自https://www.cnblogs.com/chr-wonder/p/5168858.html int *(*p(int))[3] 今天有人问这个是啥?我一看直接就懵逼了…… 下面做一些简单的 ...
- C语言深度剖析-----指针数组和数组指针的分析
指针数组和数组指针的分析 数组类型 定义数组类型 数组指针 这个不可能为数组指针,指向数组首元素 例 指针数组 例 main函数的参数 例 小结
- 嵌入式-C语言基础:指针数组(和数组指针区分开来)
指针数组:一个数组,若其元素均为指针类型的数据,称为指针数组,指针数组存放的是指针类型的数据,也就是指针数组的每个元素都存放一个地址.下面定义一个指针数组: int * p[4];//[]的优先级是比 ...
- C#委托与C语言函数指针及函数指针数组
C#委托与C语言函数指针及函数指针数组 在使用C#时总会为委托而感到疑惑,但现在总新温习了一遍C语言后,才真正理解的委托. 其实委托就类似于C/C++里的函数指针,在函数传参时传递的是函数指针,在调用 ...
- C语言语法笔记 – 高级用法 指针数组 指针的指针 二维数组指针 结构体指针 链表 | IT宅.com
原文:C语言语法笔记 – 高级用法 指针数组 指针的指针 二维数组指针 结构体指针 链表 | IT宅.com C语言语法笔记 – 高级用法 指针数组 指针的指针 二维数组指针 结构体指针 链表 | I ...
- 【嵌入式开发】C语言 内存分配 地址 指针 数组 参数 实例解析
. Android源码看的鸭梨大啊, 补一下C语言基础 ... . 作者 : 万境绝尘 转载请注明出处 : http://blog.csdn.net/shulianghan/article/detai ...
- 数据结构基础(1)--数组C语言实现--动态内存分配
数据结构基础(1)--数组C语言实现--动态内存分配 基本思想:数组是最常用的数据结构,在内存中连续存储,可以静态初始化(int a[2]={1,2}),可以动态初始化 malloc(). 难点就是数 ...
随机推荐
- TF-IDF与余弦相似性的应用(一):自动提取关键词 - 阮一峰的网络日志
TF-IDF与余弦相似性的应用(一):自动提取关键词 - 阮一峰的网络日志 TF-IDF与余弦相似性的应用(一):自动提取关键词 作者: 阮一峰 日期: 2013年3月15日 ...
- linux: /usr/bin/ld: cannot find -lloc
/usr/bin/ld: cannot find -lloc ld链接库的时候没发现loc这个库-lloc本事不是文件名字,要去找这个库就搜索libloc, loc, 不能搜索lloc. /usr1/ ...
- SQL Server 2008中文企业版下载地址和序列号[转]
SQLSERVER2008下载链接http://sqlserver.dlservice.microsoft.com/dl/download/B/8/0/B808AF59-7619-4A71-A447- ...
- asp.net 生成xml文件 与 asp生成xml文件
一.asp.net 生成xml文件 webservice方式,调用接口: public XmlDocument List() { XmlDocument doc = new XmlDocument() ...
- java实现文件传输
在windows下装了个linux虚拟机,两者之间传输文件挺麻烦的.写了个简单的文件传输程序,来方便自己数据传送. server 端: import java.io.BufferedReader;im ...
- Qt录音程序
源地址:http://www.oschina.net/code/snippet_1243295_48623 [代码] [C/C++]代码 ? 1 2 3 4 5 6 7 8 9 10 11 12 13 ...
- Customize Spring @RequestParam Deserialization for Maps and/or Nested Objects
@RestController class MyController { @RequestMapping(...) public void test(Container container) { .. ...
- javaEE开发之导出excel工具类
web开发中,一个系统的普通需求也包含导出excel,一般採用POI做统计报表导出excel. 导出excel工具类: import java.io.FileOutputStream; import ...
- C语言总结之---关键字
我记得我开始学习C语言的时候,那时候还在读高中,我们老师就把C语言的关键字,全部写在黑板上,老师说我们下面的两节课的内容就是(把它给记下来) 你还记得标准C有多少个关键字吗? 第一:关键字描述 C99 ...
- BZOJ 3110([Zjoi2013]K大数查询-区间第k大[段修改,在线]-树状数组套函数式线段树)
3110: [Zjoi2013]K大数查询 Time Limit: 20 Sec Memory Limit: 512 MB Submit: 418 Solved: 235 [ Submit][ ...