1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

C++ compile Error E166

Discussion in 'C++' started by caseywong, May 22, 2009.

  1. caseywong

    caseywong New Member

    Joined:
    May 22, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi,

    I am just started to learn C++ programming and was wondering if anyone could please help with the following error from the codes that follows:

    Error:

    v24.cpp(164): Error! E166: col(17) cannot convert right pointer to type of left operand

    From:

    if (port == COM1)
    {
    oldintv = _dos_getvect(0x0C); <- Error on this line?
    _dos_setvect(0x0C, newintvcom1);
    outp(0x0021, (intenable & 0xEF));
    }


    I am using Open Watcom C/C++ compiler and this is the error message:

    "The C++ language will not allow the implicit conversion of unrelated class pointers. An explicit cast is required:
    Example:
    class C1;
    class C2;
    void fun( C1* pc1, C2* pc2 )
    {
    pc2 = pc1;
    }"

    The source code is (i think) 16-bit and therefore I am using the win16-bit settings on the Watcom to compile the code.

    Any advice and help is much appreciated, thanks

    Best Regards
    Casey
     

Share This Page