Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
ofstream
- Page 1
Re: ofstream and fstream
Programming
Software Development
14 Years Ago
by mitrmkar
>> '
ofstream
': No such file or directory": The C++ header files are listed in this [URL="http://www.cplusplus.com/reference/"]Reference[/URL].
Re: ofstream
Programming
Software Development
19 Years Ago
by Narue
… as I can tell, it basically means do this: [code]
ofstream
foutput ( "somefile" ); Worker w; w.printOut ( … by having it accept a reference to ostream rather than
ofstream
: [code] void Worker::printOut ( ostream& out ); [/…you can merge them together. When you declare an
ofstream
object, just call the constructor at the same …
ofstream
Programming
Software Development
19 Years Ago
by WrEcK
… do it for i just need help. 1. declare an
ofstream
foutput in main function 2. open a file in main… the format we have to use [CODE]void Worker:: printOut(
ofstream
& fout) { fout << .... }[/CODE] i understand 1,2…,and 4 but i don't understand what (
ofstream
& fout) is doing or how to pass foutput to…
ofstream
Programming
Software Development
17 Years Ago
by Jennifer84
…; out to the file. Any idéas on this ? [code]
ofstream
out; out.open("C:\\File.txt") out <…
ofstream and fstream
Programming
Software Development
14 Years Ago
by Violet_82
…with "fatal error C1083: Cannot open include file: '
ofstream
': No such file or directory": [CODE]#include <…myfile.close() ; }[/CODE] if I instead replace [CODE]#include <
ofstream
>[/CODE] with [CODE]#include <fstream>[/CODE] it…create a file and input some data in it
ofstream
was enough, or if I wanted to read from…
ofstream nonsense
Programming
Software Development
14 Years Ago
by n0de
…lt;char>] pro1.cpp:142: error: ‘struct std::
ofstream
’ has no member named ‘seekg’ pro1.cpp:148: error…: ‘struct std::
ofstream
’ has no member named ‘tellg’ [/CODE] Function in …* issaugomas, int &kiekis) { string sPB; bd(sPB);
ofstream
osB(sPB.c_str()); if (osB.open()) { osB.seekg(0, ios…
Ofstream doesn't write to file in inheritance
Programming
Software Development
14 Years Ago
by Red20XX
…X[i]; s5 += 1; s6 += Y[i]; }
ofstream
out_in6("in_6",ios::out); out_in6 << s1… "/usr/tools/EE259/IO/sample_p5.h"
ofstream
the_output_file_16("out_61", ios::out); class EZ_MATH:…stdlib.h> #include<string.h>
ofstream
output_file("out.5", ios::out); class MATRIX…
Ofstream object problem
Programming
Software Development
14 Years Ago
by highflyer8
…namespace std; void errors(double, threevector,
ofstream
&); // Function that calculates the errors…else if (determinant = 'L') // Leapfrog method {
ofstream
outfile("leapfrog.txt"); outfile << "…
Re: ofstream nonsense
Programming
Software Development
14 Years Ago
by jonsca
For line 140, you want [icode] is_open() [/icode] for sure. EDIT: Also, the g in seekg is for "get pointer," which belongs with ifstream only. The corresponding functions end in p for the
ofstream
. (see [url]http://www.cplusplus.com/reference/iostream/
ofstream
/[/url] midpage).
Re: ofstream nonsense
Programming
Software Development
14 Years Ago
by n0de
… ifstream only. The corresponding functions end in p for the
ofstream
. (see [url]http://www.cplusplus.com/reference/iostream…/
ofstream
/[/url] midpage).[/QUOTE] Thanks, now I will know that if/…
ofstream Filename Problem
Programming
Software Development
15 Years Ago
by apease11
I can't seem to get [ICODE]
ofstream
[/ICODE] to use a [ICODE]dynamic name[/ICODE]. It…infoBuf); cout<<"Press Enter..."; cin.get();
ofstream
outputFile2 (title, ios::trunc); outputFile2<<"Computer Name… I put [ICODE]title[/ICODE], is that correct? [ICODE]
ofstream
[/ICODE] doesn't seem to want to create files from…
Re: ofstream nonsense
Programming
Software Development
14 Years Ago
by Ancient Dragon
you probably didn't include <fstream> and add [icode]using std::
ofstream
;[/icode]
Re: ofstream nonsense
Programming
Software Development
14 Years Ago
by n0de
i have included :) i am using ifstream in another function - and there everything is okay - no errors (in the same program, i mean). I have added [CODE]using namespace std;[/CODE] - isn't that enough, should i additionaly use [CODE]using std::
ofstream
;[/CODE] ?
Re: ofstream nonsense
Programming
Software Development
14 Years Ago
by n0de
… issaugoti (irasas * issaugomas, int &kiekis) { string sPB; bd(sPB);
ofstream
osB(sPB.c_str()); if (osB.open()) { osB.seekg(0, ios…
Re: Ofstream doesn't write to file in inheritance
Programming
Software Development
14 Years Ago
by Red20XX
[QUOTE=jonsca;1414852]Why not make the
ofstream
elements members of their respective classes? (and instantiate them in … header.So I can't really modify anything dealing with
ofstream
.
ofstream problem, not writing
Programming
Software Development
13 Years Ago
by jakezcop
…ios::trunc); walletfile << wallet; walletfile.close();
ofstream
accountfile; accountfile.open("C:/accounts/account.acnt", ios…::trunc); accountfile << account; accountfile.close();
ofstream
savingsfile; savingsfile.open("C:/accounts/savings.acnt", ios…
Re: ofstream - creating file problem
Programming
Software Development
15 Years Ago
by Danny_501
because
ofstream
.open() only takes a "const char * filename" as the argument, not a string. string.c_str() converts a string into a c string (char pointer). look at this website for more details: [URL="http://www.cplusplus.com/reference/iostream/
ofstream
/open/"]http://www.cplusplus.com/reference/iostream/
ofstream
/open/[/URL]
Re: Ofstream doesn't write to file in inheritance
Programming
Software Development
14 Years Ago
by jonsca
Why not make the
ofstream
elements members of their respective classes? (and instantiate them in …
ofstream problem
Programming
Software Development
19 Years Ago
by freemind
…]int Truck_Manager::Truck::tmp_save(Truck T, short n) { // Not complete
ofstream
of("tmp_save.txt", ios::app); of.write("…(Truck_Manager::Truck, short int)': Route_Manager.cpp:92: error: variable `std::
ofstream
of' has initializer but incomplete type << moderator edit…
ofstream.. dynamic filename and path?
Programming
Software Development
18 Years Ago
by phalaris_trip
…"; // passed to program at runtime std::
ofstream
output; output.open(fileName); // path of
ofstream
= string fileName output << "success…
ofstream and movefile
Programming
Software Development
16 Years Ago
by qeinar
if you use movefile and
ofstream
the
ofstream
file won't be made.. :s any way to solve this?
Ofstream Question
Programming
Software Development
16 Years Ago
by Dannyo329
Hi, I have a question with
ofstream
, is there anyway to ask the user for a file …; cout << "Enter filename:"; getline(cin, file);
ofstream
ofile; ofile.open(file); ofile << (stuff....); ofile.close…
Re: Ofstream Question
Programming
Software Development
16 Years Ago
by JasonHippy
[QUOTE=Dannyo329;853713]Hi, I have a question with
ofstream
, is there anyway to ask the user for a file …; cout << "Enter filename:"; getline(cin, file);
ofstream
ofile; ofile.open(file); ofile << (stuff....); ofile.close…
ofstream doesn't work or the first line isn't run
Programming
Software Development
15 Years Ago
by DimOK
… shint short unsigned int const char* InS ="input{";
ofstream
log ("C:\\Users\\DimOK\\Desktop\\Lat\\TEST1\\log.txt… ("C:\\Users\\DimOK\\Desktop\\Lat\\TEST1\\Square_Equals_Task.tex");
ofstream
o ("C:\\Users\\DimOK\\Desktop\\Lat\\TEST1\\Square_Equals_Task2.tex…
Re: ofstream doesn't work or the first line isn't run
Programming
Software Development
15 Years Ago
by tux4life
… computer? [CODE=cplusplus] #include <fstream> int main() { std::
ofstream
fout("test.txt"); fout << "Hello… correctly: [CODE=cplusplus] #include <fstream> int main() { std::
ofstream
fout("C:\\Users\\DimOK\\Desktop\\Lat\\TEST1\\test.txt…
Re: ofstream doesn't work or the first line isn't run
Programming
Software Development
15 Years Ago
by DimOK
… short unsigned int shint; const char* InS ="input{";
ofstream
logs ("log.txt"); bool EqN (ifstream &as…; "\nThe begining."; ifstream i ("Square_Equals_Task.tex");
ofstream
o ("Square_Equals_Task2.tex"); logs << "\nBefore…
Re: ofstream Filename Problem
Programming
Software Development
15 Years Ago
by apease11
…); cout<<"Press Enter...\n"; cin.get();
ofstream
outputFile2 ("version.txt", ios::trunc); outputFile2<<…
ofstream - creating file problem
Programming
Software Development
15 Years Ago
by mybluehair
I need to create a new txt file using
ofstream
, but I need to use a string to name the file. For example: [CODE] string string1 = "testfile.txt";
ofstream
myfile; myfile.open (string1);[/CODE] but when I try, it says I can do this because string is not a valid variable type for an 'open' call. Any ideas?
Re: ofstream - creating file problem
Programming
Software Development
15 Years Ago
by Danny_501
…;1260534]I need to create a new txt file using
ofstream
, but I need to use a string to name the… file. For example: [CODE] string string1 = "testfile.txt";
ofstream
myfile; myfile.open (string1);[/CODE] but when I try, it…
ofstream pointer?
Programming
Software Development
14 Years Ago
by nahmartin
… file is completed is there a way to point the
ofstream
back to the beginning of the file so that i… The lines I replace are exactly the same length [CODE]
ofstream
file_out(output_file); //lots of output to file_out file_out.close(); fstream…
1
2
3
17
Next
Last
Search
Search
Forums
Forum Index
Hardware/Software
Recommended Topics
Programming
Recommended Topics
Digital Media
Recommended Topics
Community Center
Recommended Topics
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
Backlink Auditor
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2025 DaniWeb® LLC