void countwords() { ifstream fin; fin.open("out.txt"); char word[30]; int count=0; while(!fin.eof()) { fin>>word; count++; } cout<<"Number of words in file are "<<count; fin.close(); }
Comments
Tags: count number of words, function, named, text file, Write a function to count number of words in a text file named "OUT.TXT"
ã ã‹ã‚‰åŒå§“ã«ã‚‚好感ãŒæŒãŸã‚Œãªã„ã—異性もè¦æˆ’心をæŒã¤