whattime.c

来自「·Free Chat beta release 2 fot linux,采用C语」· C语言 代码 · 共 34 行

C
34
字号
/*
  whattime.c
  
  For Free Chat
  
  By Bill Kendrick
  kendrick@zippy.sonoma.edu
  http://zippy.sonoma.edu/kendrick/

  September 29, 1996 - June 10, 1997
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "whattime.h"
#include "defines.h"


void whattime(char * buf)
{
  FILE * pi;
  char temp[STRLEN];
  
  pi = popen(DATE_CMD, "r");
  if (pi != NULL)
    {
      fscanf(pi, "%s %s %s %s", temp, temp, temp, buf);
      pclose(pi);
    }
  else
    strcpy(buf, "??:??:??");
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?