二维数组数据保留未果

二维数组数据保存未果
  欲在结构体内的二维数组中保存当地时间,然后输出保存的数据。但保存不成功。
附上代码,望大牛指导一二,谢谢。
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#include <string.h>
struct trap_log {
char  *times[20];
    char  *trap[20];
    int max;
};
static int count=0;
struct trap_log logs;
int main() {   
    int i,j,len;  
    char *tmp,*tmp1,tmp2[100];   

   for(i=0;i<5;i++) {
      time_t timep;
      
      if(count==20){count=0;}
      time (&timep);
     
      *((logs.trap)+count)="abcabc";
      if(count==2) *((logs.trap)+count)="abcdefg";


    *(logs.times+count)=ctime(&timep); //save time 

      printf("cur:%s,trap:%s,id:%d\n",*(logs.times+count),*(logs.trap+count),count);
      logs.max=count;
      count++;
      sleep(1);
   }
   i=j=logs.max;
   while(j) {//show saved data
       printf("nearest(%d):time:%s,trap:%s\n",j,*(logs.times+j),*(logs.trap+j));
       j--;
   }
   for(;i<20;i++) {
       //if(*(logs.times+i))
      ;// printf("farest(%d):time:%s,trap:%s\n",i,*(logs.times+i),*(logs.trap+i));
   }
   
   return 0;
}
c 二维数组 指针 struct

------解决方案--------------------
主要问题在于字符串不能直接赋值,而应该用strcpy进行拷贝。
------解决方案--------------------
ctime 函数返回的指针是一个静态内存的指针, 每次调用返回的值是一样的, 上次的值就被覆盖掉了.
所以, 你要保存的话, 得另外分配内存, 用 strcpy 把它拷贝出来保存.

----------------------

A call to ctime modifies the single statically allocated buffer used by the gmtime and localtime functions. Each call to one of these routines destroys the result of the previous call. ctime shares a static buffer with the asctime function. Thus, a call to ctime destroys the results of any previous call to asctime, localtime, or gmtime.