2012-10-29T09:32:14-04:00
Write a program that reads a file, breaks each line into words, strips whitespace and punctuation from the words, and converts them to lowercase
1
2012-10-29T11:13:28-0400
#include<stdio.h> #include<conio.h> #include<string.h> #include<process.h> #include<ctype.h> int main() { FILE*f; charname[50],*pch,*pch1; charch[100]; f=fopen("sample.txt","r"); if(f==NULL) { printf(" File Not Found "); getch(); exit(0); } while(fgets(ch,sizeof(ch),f)) { pch=strtok(ch,",.-"); while(pch!=NULL) { printf("%s ",pch); pch=strtok(NULL,",.-"); } } getch(); return0; }
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS !
Learn more about our help with Assignments:
C++
Comments