#include <stdio.h>
#include <time.h>
#include <string.h>
void main()
{
time_t tt;
char * p;
time(&tt);
p=ctime(&tt);
printf( "%s ",p);
printf( "length(p) = %d\n ",strlen(p));
p[strlen(p)-1]= '\0 ';
printf( "%s\n ",p);
printf( "length(p) = %d\n ",strlen(p));
}
转载于:https://blog.51cto.com/ear2hear/1007849