不是很清楚你要什麼.
就相關函式有以下..
複製程式
/**
* 1. string concat
* include <string.h>
* char *strcat( char *str1, const char *str2 );
* concatenates str2 onto the end of str1, and returns str1
*/
char s1[100] = "";
char * s2 = "test strcat";
strcat(s1, s2);
/**
* 2. about time
* #include <time.h>
* time_t time( time_t *time );
* struct tm *localtime( const time_t *time );
* size_t strftime( char *str, size_t maxsize, const char *fmt, struct tm *time );
*/
char s3[100] = "";
timt_t tnow;
struct tm * tmnow;
if (time(&tnow) != -1) {
tmnow = localtime(&tnow);
}
strftime(s3, 100, "%Y%m%d%a", tmnow);
這網站可快速 reference 函式
http://www.cppre...e.com/至於 struct tm 有興趣請用搜尋引擎找