Solved

implementing far pointers in Visual C++ 4.0

Posted on 1997-11-30
2
573 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 uin Visual C++ 4.0? (I need to implement a dynamic array of size greater than 64K using pointers.)
Thanx.
0
Comment
Question by:limin123
[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
2 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 100 total points
ID: 1174449
Win32 does not distinct a near pointer and a far pointer (and a huge pointer). All the pointers in Win32 are 32-bit (4 bytes) long. Since Visual C++ 4.0 is used to develop Win32 applications, you don't need to worry about it. Just allocate a memory area dynamically and use it as usual.
0
 
LVL 1

Author Comment

by:limin123
ID: 1174450
There is no calloc function in C Run-Time Library. It should be malloc and free. You can also use C++ operator new and delete. You may also use Win32 functions GlobalAlloc and GlobalFree.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
Suggested Courses

627 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