Solved

implementing far pointers in Visual C++ 4.0

Posted on 1997-11-30
2
564 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
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 viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

773 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