Thread: char FAR * and char *

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

    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 int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    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.

  3. #3
    Registered User Micko's Avatar
    Join Date
    Nov 2003
    Posts
    715
    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