在这段代码中
strcpy(s, "bacalaureat"); i = strchr(s, 'a') - s; // i = 1
的值为i1。为什么会这样,-s上面的作用是什么?
i
-s
c c++ string character pointer-arithmetic
c ×1
c++ ×1
character ×1
pointer-arithmetic ×1
string ×1