The * thing signifies that variable "p" is a pointer to a char (byte).
So, the assignment "char *p = sz;" assigns to p the address of the letter 'H' in the string "sz".
If you want to access the thing that "p" points to, you can write either
char x = *p;" (this is called dereferencing the pointer), or you can write "char x = p[0];" (or even, deviously "char x = 0[p];").
If you want to point to the character after the 'H', you write "p++;", so now "p" points to 'e'.
"strtok_r" is a function returning a pointer to a "char", so "str" has to be of this type too.
String handling in 'C' isn't great - it takes a while to get used to.
Thanks for the info, I have tried a couple of things but my programing skills stink. I've done something like this:
void setup()
{
Serial.begin(9600);
}
void loop()
{
if(Serial.available() > 0)
{
char message [8] = {Serial.read()}; //serial message comes in like this 10,A3,3F
char *p = message;
}
int number1 = p[1,2]; // here I get an error :'p' was not declared in this scope
int number2 = p[4,5];
int number3 = p[7,8];
}
I know that this code is rubbish, other stuf i tried was working with an array, but that doest work either
Could someone post some sample code that I can understand, cause I don't seem to get it,
The only thing I want to do is to take a string received over serial and seperate it in three variables so the arduino can work with those.