报错内容:warning: deprecated conversion from string constant to ‘char*’
我用的是ubuntu14.04下的g++
程序代码:
char *file1;
FILE *h_file;
strcpy(file1,"Hmatrix");
h_file = open_file_std(file1,"wb");
#include "open.h"
FILE *open_file_std ( char *fname,char *mode )
{
if (strcmp(fname,"-")==0)
{ switch (mode[0])
{ case 'r':
{ return stdin;
}
case 'w':
{ return stdout;
}
default:
{ fprintf(stderr,"Bad mode passed to open_file_std: %s\n",mode);
exit(1);
}
}
}
else
{ return fopen(fname,mode);
}
}
warning: deprecated conversion from string constant to 字符型指
-
- 帖子: 6
- 注册时间: 2015-11-22 17:26
- 系统: ubuntu14.04