Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 06-15-2004, 04:20 AM   #1 (permalink)
iwanttolearnc
Registered User
 
iwanttolearnc's Avatar
 
Join Date: Jun 2004
Posts: 11
iwanttolearnc is on a distinguished road
far - near pointers whats the real story

i was under the notion that far pointer or near for that matter had faded into oblivion with the arrival of FLAT MEMORY windows 9x.
but recently while going through some source code namely winsock.h and winsock2.h i saw it had plenty of far pointers . gethostbyname() for example returns a far pointer to a struct.At the same time msdn tells that far pointers are obsolete. PLEASE comment

Last edited by iwanttolearnc; 06-15-2004 at 04:53 AM.
iwanttolearnc is offline   Reply With Quote
Old 06-15-2004, 11:43 AM   #2 (permalink)
joe_bruin
LOAD "*",8,1
 
Join Date: Feb 2003
Location: la.ca.us
Posts: 254
joe_bruin is on a distinguished road
windows maintains compatibility with ancient apps by keeping the FAR and NEAR pointer naming convention. all modern applications use FAR pointers that are exactly the same as "normal" pointers.
joe_bruin is offline   Reply With Quote
Old 06-15-2004, 10:28 PM   #3 (permalink)
iwanttolearnc
Registered User
 
iwanttolearnc's Avatar
 
Join Date: Jun 2004
Posts: 11
iwanttolearnc is on a distinguished road
i tried using far pointers and got this error

#include <stdio.h>
int main(void)
{

char far * a;
char s;
a =&s;
printf("%p\n",a);

}

error C4226: nonstandard extension used : 'far' is an obsolete keyword

if FAR is used instead there is no problem. i included windows.h

if i am not mistaken FAR gets resolved to far and far into nothing
windef.h does something like this

# define FAR far


if far is obsolete keyword the how is FAR handled

shouldint far be a legitimate keyword or is there more to it

Last edited by iwanttolearnc; 06-15-2004 at 10:54 PM.
iwanttolearnc is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 11:53 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC8 ©2007, Crawlability, Inc.





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting