currently compiling a C programming for a PIC mcu in MPLAB IDE. I just want to count the length of a string and I'm using the strlen function. But it keep return the value 0. Below is my coding:
In Main loop I got this function:
BYTE RXDATA[128];
CountData(RXDATA);
And the CountData function is as below:
BYTE CountData(BYTE* pData)
{
BYTE nLen;
nLen = strlen((char*)pData);
return nLen;
}
The actual length of the RXDATA usually is more than 50 but my nLen always give me 0. Do you guys know what's wrong? Or is there any other way to count the length?