Read word from text file.
-
Hi ! Im creating program that will read one word from the text file. The word i want my program to read is PROFILE. I am beginer so I dont know much about C++ programing. I realy need help because I almost finished my program, I just need this bit of code. The file with word PROFILE in it will be named profile.txt.
-
Answer:
Hello Krystian I could help you more if I knew what the profile.txt looked like and what you needed to do once the word PROFILE was found. For now I can give you the sample code below to show you how to open a file, read it's lines, and search for a line that starts with PROFILE. I hope that helps you. Let me know if there is something in the program that you don't understand. using namespace std; void readFromFile(void) { // open the file and check that it was found ifstream in("profile.txt"); if ( ! in.good()) { cout } int main(void) { readFromFile(); }
Miningco.com Visit the source
Related Q & A:
- How to read UTF-8 .txt file in Android?Best solution by wiki.mcneel.com
- How to use hadoop for text file?Best solution by Stack Overflow
- How to delete row from text file?Best solution by Stack Overflow
- Is there a limit on the size of a new file or a text file?Best solution by Stack Overflow
- How do I read an ETD extension file?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.