int c = 0; char *str1, *str2; etk_tree_row_fields_get(row1, col, &str1, NULL); printf("Val1: '%s'\n", str1); etk_tree_row_fields_get(row2, col, &str2, NULL); printf("Comparing '%s' and '%s'\n", str1, str2); c = strncmp(str1, str2, 255); if( c < 0 ) return -1; else if( c > 0 ) return 1; else return 0;