Contact: aviboots(AT)netvision.net.il
39,885 questions
51,811 answers
573 users
#include <stdio.h> #include <string.h> #define N 4 int main(int argc, char **argv) { char s[16] = "index.php"; if (strcmp(s + strlen(s) - N, ".php") == 0) { printf(".php\n"); } else { printf("else\n"); } return 0; } /* run: .php */