In the following code, I am trying to use the _countof function in arduino. However, it's not working. I was wondering if there is a way to make the following code work in arduino. So basically i need another function that would do the samething as a _countof function.
Anybody's help will be highly appreciated.
#define PI = 3.14159265358979323846264338327950288
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <stdlib.h>
char linea[300] = "$GPRMC,023000,A,5000.00,N,01000.00,E,000.5,054.7,141010,020.3,E*68";
char status[2];
char statusA[] = "A";
char statusV[] = "V";
strncpy_s(status,_countof(status), linea +14, 1);
if(strstr(status,statusA)!=NULL)
{
etc.....
}
Well considering that the countof function doesn't work. I was wondering if the stncpy_s and strstr functions will in arduino. I mean I compiled the code after commenting out the _countof function and it didn't really show a compiling error. But just to be on the safe side, I was wondering if stncpy_s and strstr functions will actually do what they are suppose to.