- Open the sequential file in read-only mode using the following code:
fp = fopen (argv [1],"r");
- If the file does not exist or does not have enough permissions, an error message will be displayed and the program will terminate, as shown in the following code:
if (fp == NULL) { printf("%s file does not exist\n", argv[1]); exit(1); }
- Initialize the counter that will count the number of vowels in the file to 0, as shown in the following code:
count=0;
- One line is read from the file, as shown in the following code:
fgets(buffer, BUFFSIZE, fp);
- Each character of the line is accessed and checked for any lowercase or uppercase vowels, as shown in the following code:
if(buffer[i]=='a' || buffer[i]=='e' || buffer[i]=='i' || ...