What does const char far * inStrSource mean?

I follow the article about the bootloader,
( http://www.codeproject.com/KB/tips/boot-loader.aspx?msg=3745692#xx3745692xx )
and I found this part:

"const char far* inStrSource"

The whole thing:

typedef unsigned char   byte;
typedef unsigned short  word;
typedef unsigned long   dword;
typedef char            bool;

byte CString::Strlen( const char far* inStrSource )
{
        byte lenghtOfString = 0;

        while(*inStrSource++ != '\0')
        {
            ++lenghtOfString;
        }
        return lenghtOfString;
}

Can someone please explain to me why it defines char as bool and what happens with this pointer?

MVC ++ 10 recognizes them as an error (typedef char bool and char far * intSource), however, compiling with 16-bit VC 1.52 works without a doubt.

+3
source share
3 answers

This is a far pointer : a pointer that can be longer (i.e. take more bits) than regular pointers.

, (.. 8 , 2 ^ 8, ).

+2
+4

Microsoft Visual Studio 1.52 16- . , ++ . .

, bool char, ++ bool, .

far , , , 64k , "" . - , , , ( ), X86,

0

Source: https://habr.com/ru/post/1787457/


All Articles