Tip Bank

DevX - Software Development Resource

Invoking a Function Through a Pointer

When you call a function through a pointer to function, use that pointer as if it were the function itself, not a pointer. For example: #include char buff[10];void (*pf) (char

DevX - Software Development Resource

Assigning an Integer Value to an Enumeration

C++ doesn’t allow you to assign integer value to an enumeration directly: enum Direction (Up, Down};Direction dir;Dir=0; // error, can’t assign int to enum type However, you can use static_cast

DevX - Software Development Resource

Random Number Generator

Question: Is there a way to capture the last value (digit) of the system clock number and use that to generate a random number? Or look at system clock–find last

DevX - Software Development Resource

Free Store and Heap

Question: Is there any difference between heap and free store in C++? Answer: The free store is a region of memory from which a program allocates dynamic memory using new.

DevX - Software Development Resource

Servlet Variables

Question: If I declare one variable in a servlet class, and if I create many instances of that servlet, what will be the status of that variable? Answer: If the

DevX - Software Development Resource

Casts in C++

Question: Can I cast an unsigned integer to an enumerator? If so, could you provide an example? Answer: You can use static_cast to cast an int to an enumerator. However,

DevX - Software Development Resource

Servlet Resources

Question: Where is the best place to store .property files and .xml files for servlets/jsp? Right now I am using “user.home”, but there is a problem when you have multiple

DevX - Software Development Resource

Validation on Date Inputs

Question: I’m using Web Datablade and IIF to develop Web pages. I need validation (other than JavaScript) on date inputs. How can I validate dates on IIF, using SPL or