Skip to content
kerogen-pezy edited this page Jun 21, 2017 · 1 revision

日期格式处理

"18-JUL-2002,11:11:39"这样的日期时间格式你会转么?

数学方法

四舍五入: round 向下取整: floor 向上取整: ceil 取绝对值: fabs

特殊的宏

  • FLT_EPSILON : The smallest x(float) for which 1.0+x != 1.0.
  • DBL_EPSILON : The smallest x(double) for which 1.0+x != 1.0.

清除字符串中的空字符

char* deblank(char* input)
{
    char *output=input;
    int j = 0;
    for (int i = 0; i<strlen(input); i++,j++)
    {
        if (input[i]!=' ')
            output[j]=input[i];
        els
            j--;
    }
    output[j]=0;
    return output;
}

Clone this wiki locally