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
Post a Comment