Архимаг Posted September 16, 2010 Report Share Posted September 16, 2010 Привет! Давненько не практиковался в программировании, но тут внезапно возникла задача подсчета количества символов в файле *txt. Подскажите как на C++ реализовать :) Link to comment Share on other sites More sharing options...
Тролль Posted September 16, 2010 Report Share Posted September 16, 2010 (edited) Смотря считать ли и служебные символы, например, переводы строк. Если считать, то можно просто взять длину файла: #include<io.h>#include<fcntl.h>#include<iostream.h>main(){int h=open("data.txt",O_RDONLY); cout<<filelength(h); close(h); getchar();} Edited September 16, 2010 by Тролль Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now