把常用的数学模板放这里免得忘了素数表 1 int prime[maxn]; 2 void prime() 3 { 4 int i, j; 5 memset(prime, 1, sizeof(prime)); 6 for (i = 2; i 2 #include 3 usi...
分类:
其他好文 时间:
2015-06-09 19:50:31
阅读次数:
128
MEMORYSTATUSEX statex;statex.dwLength = sizeof (statex);GlobalMemoryStatusEx (&statex); _tprintf (TEXT("There is %*ld percent of memory in use.\n"), ....
*.INI内容[NETWORK]ServerIP=100.100.100.53程序:main(){char ip[16];DWORD num=0;num=GetPrivateProfileString("NETWORK","ServerIP","", ip,sizeof(ip), "Server.i...
分类:
其他好文 时间:
2015-06-09 16:57:14
阅读次数:
88
1 #include 2 #include 3 #include 4 #include 5 #define MAXN 251 6 #define _clr(x) memset(x,0xff,sizeof(int)*MAXN) 7 #define _clr(x) memset(x,0xff,si...
分类:
其他好文 时间:
2015-06-09 15:47:45
阅读次数:
119
1 #include 2 #include 3 #include 4 #include 5 #define MAXN 300 6 #define _clr(x) memset(x,0xff,sizeof(int)*MAXN) 7 using namespace std; 8 9 int hu...
分类:
其他好文 时间:
2015-06-09 15:36:57
阅读次数:
85
1 int ary[1500005]; 2 class Solution { 3 public: 4 int countPrimes(int n) { 5 int i,j; 6 memset(ary,0,sizeof(ary)); 7 int...
分类:
其他好文 时间:
2015-06-09 13:16:26
阅读次数:
91
structstu{charname[10];intage;};structstumystu[3];fwrite(mystu,sizeof(mystu),1,fp);从fwrite中注意到sizeof(mystu)不是一个数据结构structstu的长度,而是三个此结构的长度。以下是查看Linux版本信息的方法:
分类:
系统相关 时间:
2015-06-08 19:55:26
阅读次数:
155
#include #include using namespace std;int main(){ int a[] ={1,8,45,12,75,466,25,65,14,56,53}; int t; int length; length =sizeof(a)/sizeof(...
分类:
编程语言 时间:
2015-06-08 19:10:59
阅读次数:
173
typedef struct _STARTUPINFO { DWORD cb;//包含STARTUPINFO结构中的字节数.如果Microsoft将来扩展该结构,它可用作版本控制手段.应用程序必须将cb初始化为sizeof ( STARTUPINFO ) PSTR lpReserved;//保留。必...
分类:
其他好文 时间:
2015-06-08 11:22:12
阅读次数:
87
二维数组在内存中的分配如下:
C方式呈现:
#include
using namespace std;
#define ROW 3
#define COL 4
void main()
{
int **p = (int **)malloc(sizeof(int*)*ROW);
for(int i=0;...
分类:
编程语言 时间:
2015-06-07 13:51:58
阅读次数:
133