Disable Executing More than One Instance of a Program
Sometimes you don’t want to enable the option of running more than one instance of an executable at a time. This can be achieved by using this fragment of code:
Sometimes you don’t want to enable the option of running more than one instance of an executable at a time. This can be achieved by using this fragment of code:
The algorithms in the standard C++ library are generic and, as such, can be inefficient (or unavailable) with certain containers.For example, the std::swap algorithm is generic but lists define an
C-style arrays can be passed as containers to STL algorithms. The pointers to array elements can be used as iterators.Example: #include #include int main(){ int array[] = { 1, 3,
If no other classes can derive from a class, then you know that all the pointers to that class point to objects of a uniform size. This can simplify memory
There is nothing intrinsically evil about ‘switch’ statements. However, they do sometimes result from improper Object Oriented design. There are twodesign principles to keep in mind.1. Open/Closed Principle: this states
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.
// This example shows how we can use a non static// member variable or function in a static// member functionclass CClass{public: int m_Var;private: static CClass m_ptClasspublic: static void StaticMemberFonction();}CClass::CClass(){ ptClass
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
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 –>