January 18, 2000

Declaring a Volatile Member Function

You’re probably familiar with const member functions such as: class A { public: int get_x() const; // can’t change A’s state }; C++ also supports volatile member functions. You declare a member function with the volatile specifier to ensure that it can be called safely for a volatile object: class

The this Pointer

In the body of a non-static member function, the keyword this is a non-lvalue expression whose value is the address of the object for which the function is called. However, in pre-standard C++, this was actually a pointer. Although the difference between a real pointer and a “non-lvalue expression whose

Find Constant Name

Question: Instead of trapping an Error by its value (If err.number=429 then…) I would prefer to use a VB defined Constant Name.I can’t seem to find a way to locate them, if they exist. Answer: As far as I know, there only a few constants defined for error numbers. If

Databases and Large Amounts of Data

Question: I wrote a VB program that uses MS-Access (MDB) type data base using DAO . The application gathers a huge amount of information (25meg a week) and accesses the hard drive every 5 seconds. As the days pass the application gets slower and slower. The question is what would

Setting Reminders

Question: I am developing an application in VB which requires Reminders. On the basis of dates input, if the current date goes past the date in the database it should show a reminder in the form of a Messagebox. I think it will be in a timer event but I

Initialization of an Array of Classes

Question: A common practice in C is to do something like this to initialize an array of structs: typedef struct {float x,y,z;} Vector3;Vector3 VecList[] = {{1,0,0},{0,1,0},{0,0,1}};// Now VecList[0] = {1,0,0};// VecList[1] = {0,1,0}; etc… Now, I would like to do the same for a class in C++: class Vector3 {private:float

Automatic Creation of Wrapper Methods in a Class

Question: I created a class such as this: class foo { int a; int b; char *atext; float anum; int c;public : void set_a(int newa); int get_a(); void set_b(int newb); int get_b(); …} I remember once in a book they explained how these wrapper methods can be created without having

Assigning C-strings

Question: I am just beginning to learn C++ and I’ve stumble on an error that I cannot figure out despite all my efforts. Here is the code where I’m having trouble with. Thank you for any help that you can provide. //a sub function to sort a global arrayvoid sortArray(phoneAddress

Calling a C Program

Question: I’ve created a console C program that has parameters input on thecommand line and would like to create a Java application that selectsthe parameters and calls the C program from Java. Answer: The Runtime class allows you to execute system commands from a Javaprogram. Just fetch the application Runtime

No more posts to show