cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot access memory

cjaya.2
Associate II

Hi, I am having problem with string copy strncpy(). I am getting error message "Cannot access memory at address 0x31203a6e"

static char *DataBuffer[30] = {0};

for(char *str =strtok((char*)recdata, "\n\n"); str; str = strtok(NULL, "\n\n"))
{
  strncpy(DataBuffer, str, strlen(str)+2);
  strcat(DataBuffer,"\n");
  strncpy(DataBuffer, str, strlen(str)+2);
}

Is it memory addressing access faults. Is the chip failing memory handling. How do I debug it to find out.

10 REPLIES 10

NULL is not a pointer to a string pointer. Use &recdata, assuming recdata is a string pointer.

If you feel a post has answered your question, please click "Accept as Solution".