Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

implementing far pointers in Visual C++ 4.0

Posted on 1997-11-30
2
Medium Priority
?
575 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 300 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
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.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

688 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