⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vector1.cpp

📁 projapi是一个关于GIS行业投影转换的程序库
💻 CPP
字号:

#include "stdafx.h"

/* make storage for one and two dimensional matricies */#ifndef lintstatic const char SCCSID[]="@(#)vector1.c	4.4	94/03/22	GIE	REL";#endif#include <stdlib.h>#include "projects.h"
#include <math.h>

/* one dimension array */void * vector1(int nvals, int size) { return((void *)pj_malloc(size * nvals)); }	/* free 2D array */void freev2(void **v, int nrows) 
{	if (v) 
	{		for (v += nrows; nrows > 0; --nrows)			pj_dalloc(*--v);		pj_dalloc(v);	}}	 /* two dimension array */void ** vector2(int nrows, int ncols, int size) 
{	void **s;	if (s = (void **)pj_malloc(sizeof(void *) * nrows)) 
	{		int rsize, i;		rsize = size * ncols;		for (i = 0; i < nrows; ++i)			if (!(s[i] = pj_malloc(rsize))) 
			{				freev2(s, i);				return (void **)0;			}	}	return s;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -