May 26, 1998

How to use a pointer to a pointer to an int

Question: How do you use a pointer to a pointer to an int?Like this: ————–int **IntPtr;————– How do you access the value “underneath” two pointers? Answer: You can deference a pointer to a variable using an asterisk (*). You can double up asterisks to dereference a pointer to a pointer

Pointers

Question: On a test in college an instructor asked if it was possible to multiply and divide pointers. In the book we are using it says nothing about it, and I was just wondering if you could. Answer: Absolutely. A pointer is just an integer. Although it refers to a

String arrays and pointers in C++

Question: I declared a string array, char *cities[15];, to hold the names of 15 cities. I want to allow the user to enter the 15 cities, but I do not know how to use the string array in my cin statement. How do I get the data into the array?

Casting CDECL_ to an int*

Question: Is there any way of casting the CDECL_ type to *int? Answer: No, because CDECL_ is not a type. It’s a calling convention. Calling conventions specify how arguments are passed, who is responsible for restoring the stack, and so on. It has nothing to do with the type of

C++ (MFC)

Question: I am a student learning to do C++ programming with MFC. I have used InvalidateRect to update a particular area in a program. I thought invalidating reduced the flickering of an area/graphics when you repaint it, but it doesn’t really solve the problem. Is there any other way to

Saving LinkList on disk and then reading it back

Question: I have created a simple link list and would like to save it on disk and then read it back. What is the best way to do so? What if I have a huge list, and I only want to read a part of it from the disk? Answer:

OnMouseOver in Visual C++

Question: I have found many resources discussing the OnMouseOver event in JavaScript. I would like to know if this event is available in VC++ in any capacity, whether through an added event handler or if there is an IE4-like control that adds this functionality. Answer: If you are using MFC

General Protection Fault

Question: #include #include void main(){ randomize(); const int max_num=1000; int value[max_num]={0}; const num_word_per_line=8; cout