<camcorder> why not use strstr
<Zhivago> Why not just iterate the string, accumulating?
<camcorder> while ((k = strstr ("text", "c") != NULL) { i++; }
<Zhivago> Well, that isn't going to work.
<camcorder> Zhivago, why?
<Zhivago> Because it is complete gibberish.
<Zhivago> What is the value that you are assigning to k?
<camcorder> s/"text"/k/ then
<Zhivago> cam: Wouldn't help.
<Zhivago> cam: Also you didn't answer my question.
<camcorder> Zhivago, k is the pointer to the "c" ?
<Zhivago> cam: You're not assigning a pointer value to k ...
<camcorder> Zhivago, ah, that was code part, it should char *k = "text"; ((k = strstr (k, "c") != NULL) { i++; }
<Zhivago> cam: Syntax error.
<camcorder> maybe having *k++ inside the while loop is helpful :P
<Zhivago> No.
<Zhivago> Sit down, shut up and think.
<camcorder> ok again: char *k = "text"; while ((k = strstr (k, "c") != NULL) { *k++; i++; }
<Zhivago> cam: What value are you assigning to k?
<Peaker> camcorder: why *k++ and not k++ ?
<Zhivago> Because he's guessing like a moron rather than thinking.
<camcorder> Zhivago, if you have some personal problems, you can try to solve it somewhere else, like at a psychic's office