I need to open a file to read to and write to at the same time.
I cant do
infile.open(....)
outfile.open(...)
...
...
..
outfile.close();
infile.close();
Type: Posts; User: Jules
I need to open a file to read to and write to at the same time.
I cant do
infile.open(....)
outfile.open(...)
...
...
..
outfile.close();
infile.close();
Please find something and hit me over the head with it. It is a web page :rolleyes: how could I be so dense. Some times I surprise myself. If you hadn't of asked, I dont think it would have ever...
What I am doing is, I have a screen which captures certain information and saves it all to a text file. Once it has been saved, a new process is created which starts up my c++ exe which in turn does...
:eek: Ohhh
Thanx for that. Had no idea that was the case
I am trying to write back to the beginning of a file using the following:
outfile.open(fileName, ios::in|ios::nocreate)
Yes it writes to the beginning of the file but it seems to overwrite...
I cant get it to display with System.Console.WriteLine(line) and I have no idea why...but if I do SpanMessage.InnerHtml = line then it displays the output to the screen. Any ideas as to why this...
I cant even get it to display the first line :( let alone looping through the whole file.
System.Console.WriteLine(line); <--- I thought this would display at least the first line
If I could...
I am trying to display information back to my interface and dont know how to...I am really new to all this and I am stuck. What I was doing is:
try
{
using...
I need to write back to the beginning of a file with overwritting it.
Currently it opens without truncation but writes to the end of the file. How can I set it to the beginning?
...
jlou...I can not thank you enough :D wow...what an explanation, very clear and precise. FANTASTIC.
Thankyou very much. Now I get it :p
Sorry.....so does this mean int main(char "argc", char "*argv[]")
is wrong. I didn't get it.
I need to be able open a file using argv.... would I do this as
iFile.open(argv,...
Ooopps...froggy has just replied :) BUT
Im still confused... I MUST have (2 char array parameters - one for the authors name...the other has some file's path)
> int main(int argc, char...
I have a web interface that uses dos to start my program and sends it 2 parameters(string author, string fileName) to my main. My c++ program is not using the new standards (requirement) and does...
I have a web interface that is to send some information to a C++ exe file. Just for testing purposes, I have only create a main (in the prog) which creates a txt file. Once I click the button,...
I have a web interface that I need to link with my c++ program. Can anyone tell me how to link the two of them either using CGI or dll.
The program needs two parameters 1. File name 2. user name....
Just something I dont understand...Lets say you had the follwing data in a file:
cat and mouse
dog and flea
123
fish and bait
bird and worm
456
At uni we have been using Borland 4.5 and at home I have .net and Borland 4.5. and now 5.5. Because Borland 4.5 doesnt work with <iostream> and requires <iostream.h>, we have never been shown how to...
Its a borland 4.5. Our lecturer says that he will only run our programs on what the uni has. Well the format of the code is exactly as it is above and then I just run it. I dont have anything like...
g++ -o myprog.exe run.cpp test.cp
Huh!!! What is that?? Where do I put it...and can you please explain it. I have never seen anything like that. They surely didn't show or say anything at...
I have gone thru the FAQ and have gone thru search but I am still confused. My header file has only the class and is using the macro guards and my cpp file has the actual functions with an include. ...
Sorry if this seems like a silly question....
Why the const? What is this going to do and why is it important?
how about creating a pointer to a string
char *str= "smith";
OR
char *str;
cout << "enter new name";
Well I was originally reading in the words and storing them into a linked list, but I thought that this might take up alot of memory because the file it is going to read has 1000's of words.
Then...
This will do what you want.
int main()
{
ifstream infile("input.txt");
ofstream outfile("wordlist.txt");
char *word; //can hold a string of any length
I am trying to create a dynamic string array in C++ that will read in words from a file. The length of the words and how many words will belong in the array is unknown.
In the class XYZ, there is...