0day n00b question ;)

O

Ofloo

I would like to make an exe that parses the given info behind a exe to
a txt anyone who can confirm this don't know why but the thing just
freezes ??

0 errors on compile ?

// start source code <filename sparse.ccp>

// writing on a text file
#include <fstream.h>
#include <iostream.h>

int main () {
// set the parse file
ofstream sparsefile ("service.txt");
if (sparsefile.is_open())
{
int a;
int b;
int c;
int d;
int e;
int f;
cin >> a >> b >> c >> d >> e >> f;
sparsefile << a << "\n";
sparsefile << b << "\n";
sparsefile << c << "\n";
sparsefile << "\n";
sparsefile << d << "\n";
sparsefile << e << "\n";
sparsefile << f << "\n";
sparsefile << "<END>";
sparsefile.close();
}
return 0;
}

// end source code
 
P

Pieter Droogendijk

On 9 Aug 2003 03:21:37 -0700
I would like to make an exe that parses the given info behind a exe to
a txt anyone who can confirm this don't know why but the thing just
freezes ??

The standard says nothing about that 'exe' you keep talking about. And I don't
really understand what you mean, try rephrasing before posting it elsewhere.
0 errors on compile ?
What?

// start source code <filename sparse.ccp>
// end source code

This is a newsgroup about Standard C, Not C++. Try comp.lang.c++.
 
J

Jeff

Ofloo said:
I would like to make an exe that parses the given info behind a exe to
a txt anyone who can confirm this don't know why but the thing just
freezes ??

0 errors on compile ?

// start source code <filename sparse.ccp>

// writing on a text file
#include <fstream.h>
#include <iostream.h>

int main () {
// set the parse file
ofstream sparsefile ("service.txt");
if (sparsefile.is_open())
{
int a;
int b;
int c;
int d;
int e;
int f;
cin >> a >> b >> c >> d >> e >> f;
sparsefile << a << "\n";
sparsefile << b << "\n";
sparsefile << c << "\n";
sparsefile << "\n";
sparsefile << d << "\n";
sparsefile << e << "\n";
sparsefile << f << "\n";
sparsefile << "<END>";
sparsefile.close();
}
return 0;
}

// end source code

Ask in C++ group
 
G

goose

I would like to make an exe that parses the given info behind a exe to
a txt anyone who can confirm this don't know why but the thing just
freezes ??

0 errors on compile ?

try asking this in comp.lang.c++
<snipped OT c++ code>

hth

goose,
I'm going to start programming in C++ again Real Soon Now(tm)
 
D

Derk Gwen

(e-mail address removed) (Ofloo) wrote:
# I would like to make an exe that parses the given info behind a exe to
# a txt anyone who can confirm this don't know why but the thing just
# freezes ??

What do you mean by "behind a exe"? Do you mean if you type in
quelque-chose.exe 1 3 4 7 11 18
that you want to get the numbers 1, 3, 4, 7, 11, and 18?
If so, use
int main(int argc, char **argv)
and the command line arguments will be described by argc and argv
in a system specific fashion.

# int main () {

# cin >> a >> b >> c >> d >> e >> f;

This wants to read from stdin. Until it gets an eof or the expected input,
it will wait.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,227
Latest member
Daniella65

Latest Threads

Top