devxlogo

November 7, 2000

Positioning the Cursor

Question: In qbasic there is a command called LOCATE. What it does is locate where you want your output on the screen, eg: locate 1,1: meaning one down and one

Maximum Number of Characters

Question: I’m reading approximately two million characters into an array. The max number of elements that Borland Turbo C++ 5.02 allows me is not enough. Can I declare this array

Creating a Temporary File

Many applications create temporary files that exist as long as the program is running and are later discarded. For example, a Web browser can store a list of pages that

Generating a Unique Filename

To generate a unique filename that won’t conflict with any other files that exist in the current directory, use the tmpnam() function declared in as follows: char * tmpnam(char *

Designated Initializers

Another new feature in C99 is called designated initializers. Designated initializers enable you to initialize specific array elements without having to initialize the entire array. For example, suppose you have

Reading Strings that Contain White Spaces

The std::getline() functions reads data from an input stream and writes it to a string object. Unlike cin’s >> operator, getline() also reads white spaces, which makes it useful for

Changing the Endian-ness of a Number

Suppose you receive an int from a remote host and you wish to convert it to big-endian order. Here is another portable solution for handling of big and littleendian data

Send Emails From an Oracle Stored Procedure

The following code is for those who need to receive e-mails from the database to report a correct ending backup, a corrupted backup, a database fail, or any message database/admin