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

iphone - Three second countdown in cocos2d -

hyperlink - how to do url routing in php -

c - Avoiding Extra Malloc in Linked List (node->next = NULL) -