0
回答
请教怎么将bufStr return
华为云实践训练营,热门技术免费实践!>>>   
//公共配置
#include "stdio.h"
#include "stdlib.h"
#include "time.h"


char* getToken()
{   
    int originalTime, dealTime;
    char dealTimeStr[100], resStr[100], bufStr[32];
    time_t t;
    originalTime = time(&t);
    dealTime = originalTime/100;
    sprintf(dealTimeStr, "echo -n '%d%s'| md5sum", dealTime, "aaaaaa");
    FILE *fp = popen(dealTimeStr, "r");
    char tmp[1001];
    while(fp!=NULL && fgets(tmp, 1000, fp) != NULL) {
        sprintf(resStr, "%s", tmp);
    }
    pclose(fp);
    snprintf(bufStr, 33, resStr);
    printf("%d-%s--\n", strlen(bufStr), bufStr);
    return 0;

}


return bufStr string

<无标签>
举报
守望之心
发帖于2年前 0回/78阅
顶部