#include int find(char *, char); int main(int argc, char **argv) { char c; int check; if (argc == 1) printf("Should be at least one command line argument supplied after the file name\n"); else { printf("Enter a character to search the string\n"); c = getchar(); check = find(*(argv + 1), c); if (check != -1) printf("First position of the character within the string is %d\n", check); else printf("Character not found\n"); } return 0; } int find(char *inputString, char c) { int i = 0; int r = -1; while (*(inputString + i) != '\0') { if(*(inputString + i) == c) { r = i; break; } i++; } return r; }