?? array.c
字號:
/******************************************************************************Copyright (C) 1992,1993 Tony RobinsonPermission is granted to use this software for non-commercial purposes.Explicit permission must be obtained from the author to use this softwarefor commercial purposes.This software carries no warranty, expressed or implied. The user assumesall risks, known or unknown, direct or indirect, which involve this softwarein any way.Dr Tony RobinsonCambridge University Engineering DepartmentTrumpington Street, Cambridge, CB2 1PZ, UK.ajr@eng.cam.ac.uk voice: +44-223-332815******************************************************************************/# include <stdio.h># include <util/fob.h># include "shorten.h"void *pmalloc(size) ulong size; { void *ptr; ptr = malloc(size); if(ptr == NULL) perror_exit_sd("malloc(%d)", size); return(ptr);}long **long2d(n0, n1) ulong n0, n1; { long **array0; if((array0 = (long**)pmalloc(n0 * sizeof(long*) +n0*n1*sizeof(long)))!=NULL){ long *array1 = (long*) (array0 + n0); int i; for(i = 0; i < n0; i++) array0[i] = array1 + i * n1; } return(array0);}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -