August 13, 2003 problem with cin >> bool | ||||
---|---|---|---|---|
| ||||
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 Re: problem with cin >> bool | ||||
---|---|---|---|---|
| ||||
Posted in reply to Winfried Mevenkamp | 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 > > > |
Copyright © 1999-2021 by the D Language Foundation