August 13, 2003
Hi

This simple program compiled with DMC 8.34

#include <iostream.h>
using namespace std;

int main() {
   bool b;
   short n;

   cin  >> n >> b;
   cout << n << b;

   return 0;
}

gives me the following error message

dmc main.cpp -A -c -s -mld -v1 -o -3
   cin  >> n >> b;
                        ^
main.cpp(9) : Error: reference must refer to same type or be const
Had: bool
and: int &
main.cpp(14) : Error: need at least one external def
--- errorlevel 1

any ideas ?

Winfried



August 13, 2003
Try using the more modern iostream, which is <iostream>. Be sure to set the include path to include \dm\stlport\stlport.

"Winfried Mevenkamp" <gemi_gmbh@t-online.de> wrote in message news:bhd6gu$7f6$1@digitaldaemon.com...
> Hi
>
> This simple program compiled with DMC 8.34
>
> #include <iostream.h>
> using namespace std;
>
> int main() {
>    bool b;
>    short n;
>
>    cin  >> n >> b;
>    cout << n << b;
>
>    return 0;
> }
>
> gives me the following error message
>
> dmc main.cpp -A -c -s -mld -v1 -o -3
>    cin  >> n >> b;
>                         ^
> main.cpp(9) : Error: reference must refer to same type or be const
> Had: bool
> and: int &
> main.cpp(14) : Error: need at least one external def
> --- errorlevel 1
>
> any ideas ?
>
> Winfried
>
>
>