www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1996/10/27/09:25:10

From: garp AT opustel DOT com (Keith Gary Boyce)
Subject: wxwin port (More exciting c problems)
27 Oct 1996 09:25:10 -0800 :
Sender: daemon AT cygnus DOT com
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <Chameleon.846436768.garp.cygnus.gnu-win32@garp.worldnet.att.net>
Mime-Version: 1.0
Original-To: gnu-win32 AT cygnus DOT com
X-PRIORITY: 3 (Normal)
X-Mailer: Chameleon 5.0, TCP/IP for Windows, NetManage Inc.
Original-Sender: owner-gnu-win32 AT cygnus DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019