Browse DevX
Sign up for e-mail newsletters from DevX

Search the Tips
Tip Bank > C++ > Functions


1-20 of 109     Previous     Next
Using Cin.ignore() and Cin.get() Functions
by Octavia Anghel
Language: C++, Expertise: Intermediate — Learn how to not leave a terminating character in the stream.
Find All User-Defined Functions in a SQL Server Database
by Jaya Nehru
This query returns all the user-defined functions in the specified database.
Nested Functions in C++
by Alexander Ocher
Although C++ does not allow nested function declaration, you can simulate it using a structure with a static function.
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?
Calculate the Angle Between Two Lines
by Richard Bunt
This code shows you how to calculate the angle between two lines using vectors and an inverse cosine function.
The Added Benefit of Using New Instead of Malloc
by Pankaj Mishra
Not only does new allocate memory, it also calls the appropriate constructor.
Convert Descriptive Flex Fields to Numbers
by Kamlesh Jethwa
Often, data in Oracle applications is stored in extended columns known as Descriptive Flex Field (DFF) columns.
Avoiding Ambiguity in Math.h functions While Porting from 32-bit to 64-bit
by C.V. Ram
Modifying your existing 32-bit code for explicit parameters works with both 32-bit and 64-bit code and helps make porting be a bit less painful.
Overloading a Constructor or Method
by MV Prem Kumar
Overloading a constructor or a method in order to take an extra argument based upon the requirement can result in duplicate code.
Safely Downcast Pointers Without dynamic_cast Overhead
by Dick King
Try writing virtuals in the root class to do the downcasting to NULL for each of the subclasses.
Arrays of Functions
by David Bandel
Creating arrays of function pointers lets you pass functions as arguments at runtime even when you don't know the exact function needed at design time.
Execute Code Before Entering the Main Function
by Ron Stevenhaagen
Find how you can execute code before you enter the main function in C++.
When to Pass Parameters by Value
by Wael Salman
The main reason to pass parameters by value is to improve performance, which is somewhat of a paradox, because this is also one of the main reasons to pass by reference.
Passing Pointers Instead of Const Reference Parameters
by Wael Salman
If you might be passing a non-existent object, pass a pointer instead--with the understanding that it might be null
Be Careful When Assigning Data Members During Initialization
by Saurabh Ramya
Because the compiler initializes and assigns data members in the order that you declared them, you must take care when you're assigning data members during initialization.
Call a Function or Subroutine with Its String Name Using the Invoke Method
by Parthasarathy Mandayam
While the VB6 function CallByName still works in ASP.NET, you can now also use the Invoke method of the MethodInfo class to perform the same tasks. Find out how.
Use Local Classes to Implement Nested Functions in C++
by Saurabh Ramya
Find out how you can use local classes to simulate the effects of nested functions.
Return a Value and Clear It Without a Temporary Variable
by Asaf Ronen
Find out how to return a value and clear it without using a temporary variable.
Use Functor for Callbacks in C++
by Saurabh Ramya
Learn how to use the callback function in C++.
Return Numeric Data with a Thousands Separator in SQL Server
by Parthasarathy Mandayam
This tip shows a simple conversion that uses the style argument of the CONVERT function to insert commas every three digits.
1-20 of 109     Previous     Next
Thanks for your registration, follow us on our social networks to keep up-to-date