|
-
August 20th, 1999, 10:17 AM
#1
Searching text in file
Sir,
I am using Visual C++ 6.0. I need to determine number of occurances of a text say "showpage" in a file. I am using fget(c) to determine this. The problem is if the file size becomes large it takes large time to scan the file. Is there any other way that is more eficient. Is there any function available for this.
sajjad
-
August 20th, 1999, 10:23 AM
#2
Re: Searching text in file
fgetc is pretty slow since it reads one character at a time. You should try buffering it, read it into a large buffer, say 4096 in size. THen search that entire buffer for it, then read another buffer etc until the file is ended.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|