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

📄 testallocmain.c

📁 p2p类源代码 kadc协议官方源代码
💻 C
字号:
#include <stdlib.h>#include <stdio.h>int main(int argc, char *argv[]) {	int i, n;	void **p;	if(argc < 2) {		printf("usage: %s number_of_allocs\n", argv[0]);		exit(1);	}	n = atoi(argv[1]);	if((p=malloc(n * sizeof(void *))) == NULL) {		printf("can't alloc %d pointers\n", n);		exit(2);	}	for(i=0; i<n; i++) {		if((p[i]=malloc(31)) == NULL) {			printf("can't alloc of %d-th integer failed\n", i);			exit(2);		}	}	for(i=0; i<n; i++) {		free(p[i]);	}	return 0;}

⌨️ 快捷键说明

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