?
Solved

Implementing far pointers in Visual C++4.0

Posted on 1997-11-30
1
Medium Priority
?
248 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 400 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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…
An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
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.
Suggested Courses

777 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