|
From: Noorez K. <coo...@ho...> - 2004-07-21 17:03:53
|
#include <iostream>
#include <conio.h>
using namespace std;
namespace myf
{
void wait(char message[], char contin)
{
if(contin == '') //make sure that contin is not blank
{
//if it is...
cout << "Press any key to continue...";
while( !kbhit() )
{
}
return;
}
cout << message << endl; //do what is told
char get;
while(1) //loop till we get the correct value
{
get = getch(); //'empty character constant' error
if(get == contin)
{
return;
}
}
}//end wait()
}//namespace myf
I am trying to put this function into a library of other functions of my own
but I'm getting a compile error on the marked line.
_________________________________________________________________
Take charge with a pop-up guard built on patented Microsoft® SmartScreen
Technology
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
Start enjoying all the benefits of MSN® Premium right now and get the
first two months FREE*.
|
|
From: Per W. <pw...@ia...> - 2004-07-21 20:25:15
|
I think you have picked the wrong line for the error. You have the error
in:
if(contin =3D=3D '')
You might specify an empty string with "" but you may not specify an empty
character with '' - a character is always a character - just as a number
always have at least one digit. There are actually multi-character
constants too, i.e. '\r\n' is a dual-character constant. However, these
kind of character constants are a bit special and normally requires
knowledge about byte-order of the machine to be used safely.
You might write one of:
if (contin =3D=3D '\0')
or just:
if (contin =3D=3D 0)
to test for a "null" character.
/Per W
On Wed, 21 Jul 2004, Noorez Kassam wrote:
> #include <iostream>
> #include <conio.h>
> using namespace std;
>
> namespace myf
> {
> void wait(char message[], char contin)
> {
> if(contin =3D=3D '') //make sure that contin is not blank
> {
> //if it is...
> cout << "Press any key to continue...";
> while( !kbhit() )
> {
> }
> return;
> }
> cout << message << endl; //do what is told
> char get;
> while(1) //loop till we get the correct value
> {
> get =3D getch(); //'empty character constant' error
> if(get =3D=3D contin)
> {
> return;
> }
> }
> }//end wait()
> }//namespace myf
>
>
> I am trying to put this function into a library of other functions of my =
own
> but I'm getting a compile error on the marked line.
>
> _________________________________________________________________
> Take charge with a pop-up guard built on patented Microsoft=AE SmartScree=
n
> Technology
> http://join.msn.com/?pgmarket=3Den-ca&page=3Dbyoa/prem&xAPID=3D1994&DI=3D=
1034&SU=3Dhttp://hotmail.com/enca&HL=3DMarket_MSNIS_Taglines
> Start enjoying all the benefits of MSN=AE Premium right now and get the
> first two months FREE*.
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by BEA Weblogic Workshop
> FREE Java Enterprise J2EE developer tools!
> Get your free copy of BEA WebLogic Workshop 8.1 today.
> http://ads.osdn.com/?ad_id=3D4721&alloc_id=3D10040&op=3Dclick
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Jeremy A. <je...@ar...> - 2004-07-21 20:52:02
|
There is a problem with the CMYK macros in wingdi.h as supplied with DevC++ 4.9.8.10 The DevC++ version defines a different byte order to Microsoft // DEV C++ Version #define GetCValue(cmyk) ((BYTE)(cmyk)) #define GetMValue(cmyk) ((BYTE)((cmyk)>> 8)) #define GetYValue(cmyk) ((BYTE)((cmyk)>>16)) #define GetKValue(cmyk) ((BYTE)((cmyk)>>24)) #define CMYK(c,m,y,k) ((COLORREF)((((BYTE)(c)|((WORD)((BYTE)(m))<<8))|(((DWORD)(BYTE)(y))<<16))|(((DWORD)(BYTE)(k))<<24))) // Microsoft VC++ 6.0 version /* Macros to retrieve CMYK values from a COLORREF */ #define GetKValue(cmyk) ((BYTE)(cmyk)) #define GetYValue(cmyk) ((BYTE)((cmyk)>> 8)) #define GetMValue(cmyk) ((BYTE)((cmyk)>>16)) #define GetCValue(cmyk) ((BYTE)((cmyk)>>24)) #define CMYK(c,m,y,k) ((COLORREF)((((BYTE)(k)|((WORD)((BYTE)(y))<<8))|(((DWORD)(BYTE)(m))<<16))|(((DWORD)(BYTE)(c))<<24))) |
|
From: Scott S. <age...@co...> - 2004-07-21 21:17:58
|
Fill out a bug report at sourceforge.net. Jeremy Ardley wrote: > There is a problem with the CMYK macros in wingdi.h as supplied with > DevC++ 4.9.8.10 > > The DevC++ version defines a different byte order to Microsoft > > // DEV C++ Version > > #define GetCValue(cmyk) ((BYTE)(cmyk)) > #define GetMValue(cmyk) ((BYTE)((cmyk)>> 8)) > #define GetYValue(cmyk) ((BYTE)((cmyk)>>16)) > #define GetKValue(cmyk) ((BYTE)((cmyk)>>24)) > #define CMYK(c,m,y,k) > ((COLORREF)((((BYTE)(c)|((WORD)((BYTE)(m))<<8))|(((DWORD)(BYTE)(y))<<16))|(((DWORD)(BYTE)(k))<<24))) > > > // Microsoft VC++ 6.0 version > > /* Macros to retrieve CMYK values from a COLORREF */ > #define GetKValue(cmyk) ((BYTE)(cmyk)) > #define GetYValue(cmyk) ((BYTE)((cmyk)>> 8)) > #define GetMValue(cmyk) ((BYTE)((cmyk)>>16)) > #define GetCValue(cmyk) ((BYTE)((cmyk)>>24)) > #define CMYK(c,m,y,k) > ((COLORREF)((((BYTE)(k)|((WORD)((BYTE)(y))<<8))|(((DWORD)(BYTE)(m))<<16))|(((DWORD)(BYTE)(c))<<24))) > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Per W. <pw...@ia...> - 2004-07-22 00:06:15
|
Note that it is MinGW that is the Win32 port of the compiler. Dev-C++ is just a front-end. /Per W On Wed, 21 Jul 2004, Scott Simontis wrote: > Fill out a bug report at sourceforge.net. > Jeremy Ardley wrote: > > > There is a problem with the CMYK macros in wingdi.h as supplied with > > DevC++ 4.9.8.10 > > > > The DevC++ version defines a different byte order to Microsoft > > > > // DEV C++ Version > > > > #define GetCValue(cmyk) ((BYTE)(cmyk)) > > #define GetMValue(cmyk) ((BYTE)((cmyk)>> 8)) > > #define GetYValue(cmyk) ((BYTE)((cmyk)>>16)) > > #define GetKValue(cmyk) ((BYTE)((cmyk)>>24)) > > #define CMYK(c,m,y,k) > > ((COLORREF)((((BYTE)(c)|((WORD)((BYTE)(m))<<8))|(((DWORD)(BYTE)(y))<<16))|(((DWORD)(BYTE)(k))<<24))) > > > > > > // Microsoft VC++ 6.0 version > > > > /* Macros to retrieve CMYK values from a COLORREF */ > > #define GetKValue(cmyk) ((BYTE)(cmyk)) > > #define GetYValue(cmyk) ((BYTE)((cmyk)>> 8)) > > #define GetMValue(cmyk) ((BYTE)((cmyk)>>16)) > > #define GetCValue(cmyk) ((BYTE)((cmyk)>>24)) > > #define CMYK(c,m,y,k) > > ((COLORREF)((((BYTE)(k)|((WORD)((BYTE)(y))<<8))|(((DWORD)(BYTE)(m))<<16))|(((DWORD)(BYTE)(c))<<24))) > > > > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by BEA Weblogic Workshop > > FREE Java Enterprise J2EE developer tools! > > Get your free copy of BEA WebLogic Workshop 8.1 today. > > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |