So I commented out the scanf part (and just initialized it with my own string), why does it crash if I use scanf? I believe the actual arguments I've put in scanf(); are correct.
#include <stdio.h>
#include <stdlib.h>
int strendmilan(char *s,char *t)
{
int scntr = 0,tcntr = 0;
while(*(s+(scntr++)) != '\0')
;
--scntr;
while(*(t+(tcntr++)) != '\0')
;
--tcntr;
while(tcntr >= 0)
if(*(s+scntr--) == *(t+tcntr--))
;
else
return 0;
return 1;
}
int main()
{
char *s,*t;
/*
scanf("%s",s);
scanf("%s",t);
*/
s = "HAHAHACOOL";
t = "COOL";
if(strendmilan(s,t) == 0)
printf("NOT");
else
printf("YES");
getch();
}