Arduino C - censoring variable data -


i have 2 variables:

  • datarx (slave::1234)
  • globalauthcode (1234)

and comparing

     if(strcmp(datarx, globalauthcode) == 0) 

i can't find function substr php :) want leve 1234 datarx variable.

use pointer arithmetics:

strcmp(datarx + 7, globalauthcode) /*           ^^^^ */ 

the datarx + 7 skips on first 7 characters of string. of course, might want make sure string is @ least 7 characters before doing that.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -