Using MFC to do a text file statistics software automatically
Time:09-26
Can automatic statistics every characters in a text file (including Chinese characters), the number of occurrences of output for each line of the record content: characters, the number of occurrences of, a list of the number of rows, separated by commas,
CodePudding user response:
this do efficiency is not high
CodePudding user response:
Can't, the teacher asked
CodePudding user response:
# ifdef WINDOWS # define int64_t _int64 # endif Typedef struct tag_CCharStatistic { Would be buf [30].//character Int64_t Amount;//statistics the number of characters in a row Int64_t nLine;//character lines } CCharStatistic;
CCharStatistic obj. //_wfopen file stream operation, fwscanf or read fgetws, or open system calls, read read or c + + iftream flow operation, getline read open the specified file, you read the file information, through every line of every character, every character is deposited in the bank information, an instance obj, and then placed into a vector container Then according to the characters of the sorting,
Method to tell you, also gives the data structure, the rest of the organization code, it is not difficult, be careful to use Unicode way to write code, because a Chinese characters in the Unicode is treated as a character unit, do not use the way of the ANSI function,