I don't understand the user option oriented program to count sentences, words, characters, and lines
I don't really know how to start the program and what to write for the cases to get the counting to be done.
CODE
#include <stdio.h>
#include <stdlib.h>
int getOption (void);
int main (void)
{
int Option;
int curCh;
int preCh;
int countLn = 0;
int countCh = 0;
int countWd = 0;
char word = '0';
int count_sentences = 0;
float count (int option,
void get_text ();
float done = 0;
int option;
float
float
float
float
}
if (! (fp = fopen ("project44.txt", "r")))
{
printf("Error Opening project44.txt for reading");\
return (1);
//if open error
while ((curCh = fgetc (fp)) != EOF);
{
switch (option)
{
case 1:
if (curCh != '\n')
countCh++;
break;
case 2:
if (curCh !=
break;
case 3:
if (word == '0')
countWd++;
break;
case 4:
}//switch
printResult
system("PAUSE");
return 0;
}
This post has been edited by colombia23: 23 Jan, 2008 - 04:47 PM