devxlogo

Tip Bank

string::npos

Question: Could you please explain what the significance of string::npos is in the statement? someString.find_first_not_of(“0123456789”)==string::npos Answer: string::npos is a constant integer that holds the maximum value of characters that a

Returning Aggregates from a Function

Both C and C++ allow you to return by value aggregates, e.g., structs and unions, from a function. However, the runtime overhead of returning large objects by value can be

Designing a Generic Callback Dispatcher

In many applications, you need a generic class that invokes callback functions regardless of their class type. For example, an even-driven system that needs to call a member function of

Accessing a Class-Internal Type

Here’s a common error: you define a class-internal type, say an enum or typedef, and then try to use it as the return type of that class’s member function: class

Overcoming a Common Bug in

The standard functions isalpha(), isdigit(), isprint() etc., defined in the standard header or often fail to produce the right results because they assume that their arguments are of type ‘unsigned

Moving Large Mailboxes Overseas

Question: We currently have three Exchange 5.5 SP3 servers in California. We’re going to add one server in London and use x.400 connectors, but we’re not sure what the best