{ char buf[64]; unsinged long long t; snprintf(buf,64,"%llu",t); ... } 安全吗? 还是最好写成 { char buf[64]; memset(buf,0,64); unsinged long long t; snprintf(buf,64,"%llu",t); ... } 或者 { char buf[64]; unsinged long long t; if(snprintf(buf,64,"%llu",t)>-1) { } ... }行吗?
l*r
5 楼
【 以下文字转载自 Linux 讨论区 】 发信人: lilyflower (smile), 信区: Linux 标 题: what kind of language this is and how to change it? 发信站: BBS 未名空间站 (Fri Aug 8 11:58:26 2008) In my f90 source code files, it has following lines: #ifdef SYNC call mpi_barrier(mpi_comm_world,ierror) #endif what kind of languages that used? when using gfortran compiler to compile it , I got warning message as: Illegal preprocessor directive. I tried to correct it. How to change the source code or makefile a little bit so that
【在 l********r 的大作中提到】 : 【 以下文字转载自 Linux 讨论区 】 : 发信人: lilyflower (smile), 信区: Linux : 标 题: what kind of language this is and how to change it? : 发信站: BBS 未名空间站 (Fri Aug 8 11:58:26 2008) : In my f90 source code files, it has following lines: : #ifdef SYNC : call mpi_barrier(mpi_comm_world,ierror) : #endif : what kind of languages that used? when using gfortran compiler to compile it : , I got warning message as: Illegal preprocessor directive.