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.

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 0x00

in 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

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums