Tip Bank

DevX - Software Development Resource

Print the Length of the String Without Using strlen()

The following code reads one string, and prints the length of that without using strlen(): #include #include int main(){ char s[20]; gets(s); printf(” %d “,printf(“%s”,s));/*return type of printf() is int.

DevX - Software Development Resource

Pull a Date From SQL Server DateTime

SQL Server stores datetime data in 8 bytes. The first four bytes represent the date and the second four represent the time. To axe off the time part of the

DevX - Software Development Resource

Add a Tooltip for the MFC Dialog

This method works for the MFC derived class and was tested on a Dialog-based class. Set Active Project Select Project –>Add to Project –>Components and Controls –> VC++ Components –>

DevX - Software Development Resource

Adding C++ Specific Code into IDL Files

When you write an IDL file and need to add specific C++ code in the header file created after MIDL compilation, you can use the the cpp_quote(” “) IDL construct.

DevX - Software Development Resource

Avoid Nesting Errors

There are two very annoying–yet completely avoidable–nesting errors that occur in C/C++ programming.1) This one typically happens toward the end of the day, thereby making the day longer: for (int

DevX - Software Development Resource

Create a unique GUID

The System.Guid type exposes several shared and instance methods that can help you work with GUIDs, that is, those 128-bit numbers that serve to uniquely identify elements and that are

DevX - Software Development Resource

Drawing Cardinal splines

GDI+ supports two different forms of a complex curve that can’t be represented as an arc of a circle or an ellipse: a cardinal spline and a B