How to create a list from vector?

Tweet

The following sample demonstrates, how to convert a vector to list(in other words, how to create a list from vector).

The simplest way is to iterate through all elements of container and add it to the destination container. the following snippet make use of std::copy function to copy contents from source to destination container. The destination and source . . . → Read More: How to create a list from vector?

How to reverse a string (using library function)?

Tweet

Reversing a string is one of the first programs we write when we learn about loops. Anyway you don’t have to write the usual loop again to reverse a string. You can use _tcsrev ( _strrev ) function to reverse a character buffer. See the sample below

int _tmain(int argc, _TCHAR* argv[])
{
TCHAR buff[] = _T( "Hello World!");
_tcsrev( . . . → Read More: How to reverse a string (using library function)?