nazerke
5/9/2019 - 5:46 PM

compare 2 strings if they are equal

int stringEqual(char* str1, char* str2){
  const char* p1 = str1;
  const char* p2 = str2;
  while(*p1 == *p2){
    if(*p1 == '\0'){
      return 1;
    }    
    //advance p1 and p2 to point at the next letter
    p1++;
    p2++;
  }  
  return 0;
}