Mail Archives: cygwin/1996/10/27/09:25:10
Does any one understand why I am getting following errors compiling
program below?
bash$ gcc -I/usr/lib/g++-include -o garp.exe garp.c
In file included from /usr/lib/g++-include/iostream.h:31,
from garp.c:2:
/usr/lib/g++-include/streambuf.h:35: syntax error before string
constant
In file included from /usr/lib/g++-include/iostream.h:31,
from garp.c:2:
/usr/lib/g++-include/streambuf.h:37: syntax error before `}'
bash$
Here's the simple program i'm trying to compile
#include <stdio.h>
#include <iostream.h>
#include <fstream.h>
#include <stdlib.h>
main ()
{
ofstream outfile("/tmp/foo2.dat", ios::out);
if (!outfile) {
cerr << "File could not be opened" << endl;
exit(1);
}
cout << "Enter acct, name and balance" << endl
<< "Enter to finish" << endl << "? ";
int account;
char name[10];
float balance;
while (cin >> account >> name >> balance) {
outfile << account << ' ' << name
<< ' ' balance << endl;
cout << "? ";
}
return 0;
}
-------------------------------------
Name: Garry Boyce
E-mail: garp AT opustel DOT opustel DOT com (Garry Boyce)
Date: 12/01/94
Time: 08:46:10
This message was sent by Chameleon
-------------------------------------
-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
- Raw text -