I was writing and getting my input from the wrong file thus I was getting a return of -1. Anyway, I thank you to all that replied. Here is what I really did and I owe someone from another site a big thank you.
int _tmain(int argc, _TCHAR* argv)
int count1 = 1,spaces=0,tabs=0,lines=1,punct = 0, digits=0;
fout = fopen("e:/cop1220/final/wordout.txt","w");
fin = fopen("e:/cop1220/final/wordin.txt","r");
while ((ch = fgetc(fin)) != EOF)
if (isdigit(ch)) ++digits;
if (ch == ' ') ++spaces;
if (ch == '\t') ++tabs;
if (ch == '\n') ++lines;
if (ispunct(ch)) ++punct;
//printf("%d,%d,%d,%d,%d %d \n", chars, spaces, tabs, lines,digits,punct);
fprintf(fout,"Count of characters = %d\n",chars);
fprintf(fout,"Count of digits = %d \n",digits);
fprintf(fout,"Count of spaces = %d \n",spaces);
fprintf(fout,"Count of tabs = %d \n",tabs);
fprintf(fout,"Count of lines = %d \n",lines);
fprintf(fout,"Count of punctuation = %d \n",punct);
Edited 3 Years Ago by mike_2000_17: Fixed formatting
i am using visual studio 2015 and trying to export data which i am importing through excel by the user selected Excel file. Now the importing part has been successfully completed i am using OLEDB Connection but Stuck in exporting the same data to a new Excel file. tried ...
I am creating a program that when you print an author, you must show all the information of all the books that the author has written. Add a new attribute in the Author class that will be "BooksWriting: List (Book)".
I am currently creating a simulation of a pizza ordering system in object oriented program. I have some question. the instruction and guideline is long but I will try and cut it down a lot. the instruction is to create a program that simulate a pizza restaurant using ...