Browse DevX
Sign up for e-mail newsletters from DevX

Search the Tips
Tip Bank > C++ > Operators


1-20 of 61     Previous     Next
Using -- and ++ Operators
by Octavia Anghel
Language: C++, Expertise: Beginner — Learn why you should try to use only unary operators for incrementing and decrementing variables.
Use Comparison Operators in SQL to Remove/Return Columns with Null Values
by Srinath MS
When you use the comparison operators in SQL with the Where clause, you can remove the columns with null values.
Using the Triple Equals Sign Operator (===) to Check Variable Type and Value
by Aneel Maheshwari
This single operator tests variables for equivalency—both type and value—in one line.
Incrementing a C# Variable Efficiently
by Bashir Nabeel
Avoid postfix operators when incrementing composite objects.
Handle Null in JavaScript with the "||" Operator
by Srinath MS
Instead of using the ternary operator to handle a null value and set the default values, you can use the "||" operator.
Using the << and >> XQuery Operators
by Leonard Anghel
Find out how to use the << and >> XQuery operators.
Overloading the const and non-const Member Functions
by Prashanth Narayanaswamy
We all know about the function overloading feature in C++, which allows us to have the same name given for a function with different signatures. But what about overloading based on the const-ness of a member function?
The Sizeof() Operator Only Works at Compile Time
by Tony Madhur
The Sizeof () operator only works at compile time and doesn't evaluate anything at run time.
Object Functions in Use
by Arman Sahakyan
You can use an object function to find the first occurence of a string started by a given symbol in a vector.
Protect Smart Pointers by Providing Multiple Interfaces
by Vijai Kalyan
The standard way of designing smart pointers provides a mutable interface to the underlying objects--even though you might not want that. But you can protect the underlying objects by providing both a mutable and an immutable interface.
Stop Initializing and Assigning Values to the Base Class's Data Members
by Saurabh Ramya
Sick of initialzing and assigning values to the base class's data members? Absolve yourself of this responsibility by overloading the copy constructor and the assignment operator in the derived class.
Simplify Operator Overloading
by Sophy Pal
Operator overloading may seem like a complicated task, but in fact, it's really simple. This tip describes two easy ways you can overload operators.
Determine Object Size Without Using the sizeof() Operator
by Nahappan Somasundaram
Learn how to use pointer arithmetic to determine object size—instead of the sizeof() operator.
Create an Easy to Use Clamp Template for Constraining Values
by James Turk
This template uses two types, so that the in value doesn't have to be the same type as the constraints.
Using the Const_cast Operator
by Sridhar Reddy
The const_cast operator takes the ...
Uses of the
by Danny Kalev
The volatile specifier disables various optimizations that a compiler might automatically apply and thus introduce bugs. I
Classes and Structs -- What's the Difference?
by Danny Kalev
The keywords struct and class are almost interchangeable in C++. You can declare a struct that has member functions, constructors, destructor, base classes and so on as if it were a ...
Casts in C++
by DevX Pro
Can I cast an unsigned integer to an enumerator? If so, could you provide an example?
Invoking Overloaded Operators Explicitly
by Danny Kalev
The overloaded operator mechanism is "syntactic sugar" for ordinary function calls. You can always use the explicit name of an overloaded operator function to resolve ambiguities or document your ...
Indirection Operator
by DevX Pro
Can you use the indirection operator like a memcpy to copy the contents of a structure like this? *m_pMyInfo = stMyInfo; Or should you use the memcpy function? memcpy(m_pMyInfo, &stMyInfo, sizeof(MY_INFO));
1-20 of 61     Previous     Next
Thanks for your registration, follow us on our social networks to keep up-to-date