Click here to Skip to main content
14,739,420 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i am working in mfc c++.
i want to search a cstring in text file. such that if the string is found it displays successfull and if not it displays not found.

suppose that the text file in which i am seraching its's path is "C:/users/projects/klop.txt"

kindly do help how to code

What I have tried:

i am working in mfc c++.
i want to search a cstring in text file. such that if the string is found  it displays successfull and if not it displays not found.

suppose that the text file in which i am seraching its's path is "C:/users/projects/klop.txt"

kindly do help how to code
Posted
Updated 10-Oct-18 21:34pm
Comments
Mohibur Rashid 11-Oct-18 1:16am
   
Let's go back to the age old question, "What have you tried?"

1 solution

Yoz must load the file into memory and search for it. Use StdioFileand the Find function of CString.

Tip: check for errors like file not read and substring not found.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900