![]() |
| ||
| fstream problem.. Hi all. I want to learn how to manipulate .txt files through C++ program. I want to be able to search trough chars in .txt file,sort them etc. I think the best way for this,should be,loading .txt file in char array and then manipulating the elements. but I don't know how.. #include <iostream.h> |
| ||
| Re: fstream problem.. Simple example.. Open a files, |
| ||
| Re: fstream problem.. You can do this quite elegantly with the STL... might be advanced, I dunno. #include <fstream> Edit: Note, this ignores whitespace. Also change #include <iostream.h>to #include <iostream> |
| ||
| Re: fstream problem.. Sort chars? What for?!.. Can you explain what do you want to do with a file contents? |
| ||
| Re: fstream problem.. ]it doesn't work with getc, it says "getc- undeclared identifier" btw I'm using visual c++ compiler I just want to take char from .txt file,and save it in char variable..or in array I have also tried this way: #include <iostream.h>but the compiler says thar it cannot convert parameter 2 from 'class fstream' to 'char *' |
| ||
| Re: fstream problem.. Quote:
if (rufile.get(c)) {Set cursor on a function name and press F1. Look at the function prototype. Do you want ask daniweb for every new C++ function parameters? |
| All times are GMT -4. The time now is 4:15 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC