Solved

Implementing far pointers in Visual C++4.0

Posted on 1997-11-30
1
246 Views
Last Modified: 2006-11-17

In Borland C, there is a function farcalloc that allocates far pointers.
Is there such a function in Visual C++ 4.0?
Or is there any other way to implement far pointers in Visual C++ 4.0? (I need to implement a dynamic array of size greater than 64K using pointers.)
Thanx.
0
Comment
Question by:dawn123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 100 total points
ID: 1256466
With Visual C++, you can target only 32bit Windows. As such, there is no concept of far or near pointers because every pointer can address 4 gigabytes. So you can write in C,

  char* foo = (char*)malloc(1000000);

or in C++

  char* foo = new char[1000000];

Memory models are in the past with 32-bit Windows. It is required only in 16-bit world on the PC.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question