devxlogo

Tip Bank

Creating and Executing a Variable as a Query

Question: How do I create a stored procedure that will construct and execute a query from its parameters? At the heart I’d imagine something like this, for simplicity’s sake: declare

Converting Number to Date

Question: How do I convert a number that represents a date into a date field? The number’s format is CCYYMMDD. Answer: Fortunately, the format of your numeric value doesn’t need

Renaming a File

To rename a file, use the standard function rename() (declared in ). This function takes two arguments of type const char *, the first of which is the old name

Deleting a File

The standard function remove() deletes a file. It takes one argument of type const char * which is the name of the file to be deleted. You can provide a

Obtaining the Max Value from an Array

Question: How can I make a function to return and display the maximum number in the following array: int my_array[]={10,3,35,101,65,100}; Answer: First, sort the array. Then display the last element

RMIC and Inner Classes

Question: Can RMIC make stubs for inner classes? When I tryrmic packagename.OuterClassName$InnerClassName, it doesn’t work. Answer: Yes, RMIC can make stubs for inner classes. However, you must use thefully qualified

Sorting a Vector

Question: I have data in a Vector and need to sort it before displaying iton the screen; how do I do this? Answer: The Java 2 Collections Framework provides a

New & Malloc

Question: I understand that most of the time, new and malloc may use the same allocation routines, but does that necessarily mean new calls malloc? I am asking because I

Superclass Variables Referencing Subclasses

Question: What is the advantage of declaring a variable as a superclass referenceand then pointing that variable to an instance of a subclass? Theway I see it, I can achieve