The *
i seeing '*' character used things not related math. maybe has been way, don't remember seeing used this;
char *p = sz;
can explain * doing? think means "any" or "unknown". clarification good.
char *p = sz;
can explain * doing? think means "any" or "unknown". clarification good.
code: [select]
char* p;
char *q;these lines declare variable called p, not contain character, rather address in memory of character. this called "char pointer." often, pointer used point whole string of chars @ once. (the difference between these 2 lines style; prefer former style, many prefer latter.)
the sz refer common way "a string ending in 0 character," common form of string. when use double-quotes in c, making string of characters ending in 0 character. the pointer first character actual value used, has kept in char pointer variable.
code: [select]
char* p = "abc"; // point string of chars 0x41 0x42 0x43 0x00in expression, can "follow" pointer see what's @ address. including *p in expression means @ char @ address described p, not value of p itself. after line above, *p 'a' , *(p+1) 'b'.
confusing @ first. time go "pointers" in book on c.
Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > The *
arduino
Comments
Post a Comment