-
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?
-
FAR is a relic from when M$ thought DOS was still a good idea.
You can ignore it
-
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?
-
Pretty much. Pointers are pointers and functions are functions as far as we're concerned (pun... haha! :D). 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. :)