#include #include int main() { int numWords = 0; int numLines = 0; int numBytes = 0; int currLocation = 0; //char *buff = (char*) malloc(sizeof(char)*128); //char *myStream = (char*) malloc(sizeof(char)*4096); char buff[128]; char myStream[4096]; printf("Please enter file name:: "); scanf("%s", &buff); myStream = fopen(buff, "r"); while(myStream[currLocation] != NULL) { if(myStream[currLocation] == ' ') numWords = numWords+1; else if(myStream[currLocation] == '\n') numLines = numLines+ 1; } printf("Number of words = %d", numWords); printf("Number of lines = %d", numLines); return 0; }