Contact: aviboots(AT)netvision.net.il
40,772 questions
53,159 answers
573 users
#include <stdio.h> #include <string.h> int main() { char s[64] = "c python c++ java c++ php c++"; char *p = s; while( (p = strstr(p + 1, "c++")) ) { printf("%d ", p - s); } return 0; } /* run: 9 18 26 */