Mail Archives: djgpp/1999/09/19/14:54:26
From: | "Damian Yerrick" <web DOT poison AT pineight DOT 8m DOT com>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Re: program won't compile
|
Date: | Sun, 19 Sep 1999 13:13:41 -0500
|
Organization: | Rose-Hulman Institute of Technology
|
Lines: | 44
|
Message-ID: | <7s398m$oq6$1@solomon.cs.rose-hulman.edu>
|
References: | <000801bf028d$43111320$6ff343c3 AT marocky>
|
NNTP-Posting-Host: | yerricde.laptop.rose-hulman.edu
|
X-Trace: | solomon.cs.rose-hulman.edu 937764950 25414 137.112.205.146 (19 Sep 1999 18:15:50 GMT)
|
X-Complaints-To: | news AT cs DOT rose-hulman DOT edu
|
NNTP-Posting-Date: | 19 Sep 1999 18:15:50 GMT
|
X-Priority: | 3
|
X-MSMail-Priority: | Normal
|
X-Newsreader: | Microsoft Outlook Express 5.00.2314.1300
|
X-MimeOLE: | Produced By Microsoft MimeOLE V5.00.2314.1300
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
Hakan Venderlof <grok AT telia DOT com> wrote in message
news:000801bf028d$43111320$6ff343c3 AT marocky...
> When I try to compile this program djgpp returns this:
>
> #include expects "FILENAME" or <FILENAME>
>
> What is wrong?
I looked at your source (t.cpp) in MS-DOS Editor. I see nothing wrong with
your C++, but it seems you have musical notes where you want returns, and
this is confusing the preprocessor (the part of the compiler responsible for
handling #include and #define). Your preprocessor expects 0x0d 0x0a (CR LF),
or DOS format returns, and you are feeding it 0x0d (CR), or Macintosh format
returns. I suggest deleting each of the first few returns and retyping them.
Damian Yerrick
http://pineight.webjump.com/
#include <iostream.h>
int Add (int x, int y)
{
cout << "In Add(), received " << x << " and " << y << "\n";
return (x+y);
}
int main()
{
int a, b, c;
cout << "Enter two numbers: ";
cin >> a;
cin >> b;
c=Add(a,b);
cout << "sum is" << c;
cout << "\nExiting...\n\n";
return 0;
}
- Raw text -