Click here to Skip to main content
15,891,136 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMAPIAllocateBuffer Pin
Peter Weyzen15-Dec-05 12:27
Peter Weyzen15-Dec-05 12:27 
QuestionForms Tutorial Pin
Daniel Odom15-Dec-05 12:12
Daniel Odom15-Dec-05 12:12 
AnswerRe: Forms Tutorial Pin
Mark F.23-Dec-05 10:05
Mark F.23-Dec-05 10:05 
QuestionComipling using the cl command Pin
Soaring Eagle15-Dec-05 11:54
Soaring Eagle15-Dec-05 11:54 
AnswerRe: Comipling using the cl command Pin
PJ Arends15-Dec-05 14:12
professionalPJ Arends15-Dec-05 14:12 
AnswerRe: Comipling using the cl command Pin
TheGreatAndPowerfulOz15-Dec-05 16:19
TheGreatAndPowerfulOz15-Dec-05 16:19 
QuestionCapturing from a hidden webbrowser Pin
Rheikon15-Dec-05 9:53
Rheikon15-Dec-05 9:53 
QuestionProblem about output files Pin
knapak15-Dec-05 9:32
knapak15-Dec-05 9:32 
Hi all

I have a code that runs a simulation producing numeric outputs of a time series multiple times. I don't know in advance how long is the series or how many times the simulation will run (defined by user at run time). I would like to have the program to write the results out to a file in one column per simulation run instead of a single column where the result of each simulation is separated by some marker.

The code to write the output in one column would be something like this:

<code>ofstream WriteOutput(OutputData.out,ios::app)
for(sim=1; sim<=nsims; sim++)
{
for(t=1; t<=n; t++)
{
y=f(x[t]);
WriteOutput >> y >> endl;
if(t==n) WriteOutput >> "#" >> endl;
}
}</code>

This produces an output like this:

3
4
5
6
#
4
5
6
7
#

Instead, I'd like a code to write an output such as:

3 4
4 5
5 6
6 7

How can I do this?

Thanks!

C.
AnswerRe: Problem about output files Pin
Chris Losinger15-Dec-05 10:01
professionalChris Losinger15-Dec-05 10:01 
GeneralRe: Problem about output files Pin
knapak15-Dec-05 10:07
knapak15-Dec-05 10:07 
GeneralRe: Problem about output files Pin
Nish Nishant15-Dec-05 10:11
sitebuilderNish Nishant15-Dec-05 10:11 
GeneralRe: Problem about output files Pin
knapak15-Dec-05 10:51
knapak15-Dec-05 10:51 
GeneralRe: Problem about output files Pin
Nish Nishant15-Dec-05 11:16
sitebuilderNish Nishant15-Dec-05 11:16 
AnswerRe: Problem about output files Pin
PJ Arends15-Dec-05 13:49
professionalPJ Arends15-Dec-05 13:49 
QuestionHow to set the initial directory of the CFileDialog to be 'My Computer'? Pin
Cyrus Dang15-Dec-05 9:23
Cyrus Dang15-Dec-05 9:23 
AnswerRe: How to set the initial directory of the CFileDialog to be 'My Computer'? Pin
Nish Nishant15-Dec-05 9:34
sitebuilderNish Nishant15-Dec-05 9:34 
GeneralRe: How to set the initial directory of the CFileDialog to be 'My Computer'? Pin
Cyrus Dang15-Dec-05 9:46
Cyrus Dang15-Dec-05 9:46 
GeneralRe: How to set the initial directory of the CFileDialog to be 'My Computer'? Pin
David Crow15-Dec-05 10:09
David Crow15-Dec-05 10:09 
GeneralRe: How to set the initial directory of the CFileDialog to be 'My Computer'? Pin
Nish Nishant15-Dec-05 10:09
sitebuilderNish Nishant15-Dec-05 10:09 
QuestionQuestion on SOAP with Attachments/DIME/Web Services Pin
Anaxarchos15-Dec-05 7:54
Anaxarchos15-Dec-05 7:54 
QuestionCFileDialog allows bad filenames Pin
Ally_Sutherland15-Dec-05 7:23
Ally_Sutherland15-Dec-05 7:23 
QuestionRe: CFileDialog allows bad filenames Pin
David Crow15-Dec-05 7:31
David Crow15-Dec-05 7:31 
AnswerRe: CFileDialog allows bad filenames Pin
Ally_Sutherland15-Dec-05 7:54
Ally_Sutherland15-Dec-05 7:54 
QuestionHow to simulate clicks on toolbar buttons? Pin
Cyrus Dang15-Dec-05 7:19
Cyrus Dang15-Dec-05 7:19 
AnswerRe: How to simulate clicks on toolbar buttons? Pin
Maximilien15-Dec-05 7:49
Maximilien15-Dec-05 7:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.