📄 calloc.c
字号:
/* Demonstrates calloc(). */
#include <stdlib.h>
#include <stdio.h>
int main( void )
{
unsigned long num;
int *ptr;
printf("Enter the number of type int to allocate: ");
scanf("%ld", &num);
ptr = (int*)calloc(num, sizeof(long long));
if (ptr != NULL)
puts("Memory allocation was successful.");
else
puts("Memory allocation failed.");
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -