?
Solved

Export Engine

Posted on 2005-03-15
4
Medium Priority
?
187 Views
Last Modified: 2010-04-01
I need to know how you go about having a program export to a text or another format. I am currently working on an assignment trying to create a small resume prog that will export to a text file or XML. Anyone hoave any examples on how to perform that function?
0
Comment
Question by:xardious
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 3

Expert Comment

by:r_a_j_e_s_h
ID: 13552946
u should know the base file format of the export format.... then  u can use filestream to export to that format...
0
 

Author Comment

by:xardious
ID: 13560769
Do you have any code examples of how it is done?
0
 
LVL 40

Accepted Solution

by:
Kyle Abrahams earned 2000 total points
ID: 13561869
look up fstreams.

specifically you want to open an ofstream to a file you create, from there you can "cout" the same way you do to the monitor, but instead of couting you use the ofstream to write it to the file.  Just close the file when you're done.

below is a reference that has some examples:
http://www.cplusplus.com/doc/tutorial/tut6-1.html
0
 
LVL 12

Expert Comment

by:OnegaZhang
ID: 13571912
#include <fstream>

            std::ofstream databaselist("databaselist.txt");
            databaselist<<"database list of test"<<std::endl;
for(int i=0;i<3;i++)
databaselist<<i<<std::endl;
            databaselist.close();
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question