当前位置: 技术问答>linux和unix
警告 assignment makes integer from pointer without a cast是怎么回事
来源: 互联网 发布时间:2016-05-13
本文导语: 写了一个函数 void get_time(long* ptime) { char buff[4096+1]; int len , i ; char* pstr; FILE* fp; fp=NULL; fp=fopen("/proc/stat","r"); if(fp !=NULL) { len = fread(buff,sizeof(char),sizeof(buff)-1,fp); fclose(fp); }else {...
写了一个函数
void get_time(long* ptime)
{
char buff[4096+1];
int len , i ;
char* pstr;
FILE* fp;
fp=NULL;
fp=fopen("/proc/stat","r");
if(fp !=NULL)
{
len = fread(buff,sizeof(char),sizeof(buff)-1,fp);
fclose(fp);
}else
{
fclose(fp);
}
buff[len] ="";
pstr=sko_token(buff);
for(i = 0 ; i
void get_time(long* ptime)
{
char buff[4096+1];
int len , i ;
char* pstr;
FILE* fp;
fp=NULL;
fp=fopen("/proc/stat","r");
if(fp !=NULL)
{
len = fread(buff,sizeof(char),sizeof(buff)-1,fp);
fclose(fp);
}else
{
fclose(fp);
}
buff[len] ="";
pstr=sko_token(buff);
for(i = 0 ; i