This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

C++ pointers with Tasking

Here is some very simple c++ code made in tasking. This is a c++ project. This don't work! What is wrong? If i compile it in C, all is working well. So what can i do if i need c++ compiler???
(U16 => unsigned short)
(U32 => unsigned long)

int Fnc1(U32 ptrU16)
   {
   __far U16   *hpt = (__far U16 *)ptrU16;

   *hpt = 0x0b;

   return 0;
   }
int Fnc2(__far U16 *ptrU16)
   {
   *ptrU16 = 0x0b;

   return 0;
   }
int main(void)
   {
   U32          adr = 0x200004;
   __far U16   *pt;

   //this work
   pt = (__far U16 *)adr;
   *pt = 9;
   //that dont work !!!
   Fnc1(adr);
   //that make a compile error !!!
   //Fnc2(pt);
   }

0