char FAR * and char *

This is a discussion on char FAR * and char * within the C++ Programming forums, part of the General Programming Boards category; Hi, I started learn socket api and found this in book: Code: struct protoent { char FAR * p_name; char ...

  1. #1
    Registered User Micko's Avatar
    Join Date
    Nov 2003
    Posts
    712

    char FAR * and char *

    Hi,
    I started learn socket api and found this in book:
    Code:
    struct protoent {
    	char FAR *	p_name;
    	char FAR * FAR *p_aliases;
    	short		p_proto;
    };
    I've never seen this: FAR

    What that means?

    I have win XP, Visual c++ .net

    I experimented and determined that it is practically same to use
    char FAR* and char*.
    What is purpose of FAR?

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,344
    FAR is a relic from when M$ thought DOS was still a good idea.
    You can ignore it
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User Micko's Avatar
    Join Date
    Nov 2003
    Posts
    712
    So, for example when I see:

    Code:
    struct hostent FAR * PASCAL FAR gethostbyname ( const char FAR * name);
    I can interpret it as:

    Code:
    struct hostent * gethostbyname ( const char * name);
    Right?

  4. #4
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    Pretty much. Pointers are pointers and functions are functions as far as we're concerned (pun... haha! ). PASCAL is just a different calling convention (ooo, big words), which still doesn't concern us as long as we're just using the function.
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21