Exemplo n.º 1
0
int MAX::renew()
{

  BufIn(GPSBuf);
  int i = getPhrase(GPSBuf, GPSPhr);
  if(i == 1) return 0;  //not renewed 
  else{
    String tempLat = getLat(GPSPhr);
    String tempLng = getLong(GPSPhr);
    String temphgt = getHigh(GPSPhr);

    int a = spellCheck(tempLat);
    int b = spellCheck(tempLng);
    int c = spellCheck(temphgt);

    if(a == 0) {sLatitude = tempLat;}
    if(b == 0) sLongitude = tempLng;
    if(c == 0) sHeight = temphgt;
    int r = StoF();
    
    if(r==0){
      count ++;
      return 1;
    }
    else if(r==-1) {return 0;}
  }
}
Exemplo n.º 2
0
int main(void) {
  char * phrase = getPhrase(phrase);
  char phrase_copy[MAX_STRING_SIZE];
  strcpy(phrase_copy, phrase);
  keep_chars(phrase_copy);
  toLowerCase(phrase_copy);
  if(isPalindrome(phrase_copy)) {
    printf("\nThe phrase: %s\nIs a palindrome!\n",phrase);
  } else {
    printf("The phrase: %s\nIs not a palindrome!\n",phrase);
  }
  
  free(phrase); //frees malloc   
  return 0;
}