易采站长站为您分析C语言获取消耗内存的方法,涉及C语言中malloc方法的使用技巧,非常简单实用,需要的朋友可以参考下
本文实例讲述了C语言获取消耗内存的方法。。具体实现方法如下:
- /* * 消耗内存
- */ #include <stdio.h>
- #include <stdlib.h> main()
- { int MB=0;
- while(malloc(1<<20)) ++MB;
- printf("Alloced %d MB totaln",MB); }
希望本文所述对大家的C语言程序设计有所帮助。
易采站长站为您分析C语言获取消耗内存的方法,涉及C语言中malloc方法的使用技巧,非常简单实用,需要的朋友可以参考下
本文实例讲述了C语言获取消耗内存的方法。。具体实现方法如下:
- /* * 消耗内存
- */ #include <stdio.h>
- #include <stdlib.h> main()
- { int MB=0;
- while(malloc(1<<20)) ++MB;
- printf("Alloced %d MB totaln",MB); }
希望本文所述对大家的C语言程序设计有所帮助。

2023-03-15
0万阅读

2023-03-15
0万阅读

2023-03-15
0万阅读

2023-03-15
0万阅读

2023-03-15
0万阅读

2023-03-14
0万阅读

2023-03-13
0万阅读

2023-03-13
0万阅读

2023-03-13
0万阅读

2023-03-13
0万阅读

2023-03-15
0万阅读

2023-03-15
0万阅读

2023-03-15
0万阅读

2023-03-15
0万阅读

2023-03-15
0万阅读

2023-03-14
0万阅读

2023-03-13
0万阅读

2023-03-13
0万阅读

2023-03-13
0万阅读

2023-03-13
0万阅读