-----Original Message----- 
From: girishkolari [mailto:girishkolari@yahoo.co.in] 
Sent: Sun 11/28/2004 9:58 AM 
To: C-Guru@yahoogroups.com 
Cc: 
Subject: [C-Guru] help


> main()
>  {
>   int i;
>   char far *vidmem=0xB8000000;
         ^^^

One.  "far" is a non-portable extension of Turbo C/C++ compilers for
the DOS environment.

Two.  By default, the expression, 0xB8000000, is an integer and you're
assigning it to a pointer.  Do as follows to suppress the warning:

    char far *vidmem = (char far *) 0xB8000000;

>   for(i=0;i<=3999;i=i+2)
>     *(vidmem+i='A');
        ^^^^^^^^^^^^
Shall I consider it as a typing mistake, or your poor understanding of
pointers?  Whatever, the above expression should have been:

    *(vidmem+i) = 'A';

Taking vidmem as the base, you want to write the character 'A' at an offset
mentioned by i.

>  }
> i have warning in 'char far *....' !Non portable pointer assignment
> in function main , can any one help me in this

-- 

    Source: geocities.com/vijoeyz/faq/c

               ( geocities.com/vijoeyz/faq)                   ( geocities.com/vijoeyz)