Category: c / c++
Quite often, we need to loop an array but dealing with continuous two elements at each iteration. This sounds an easy task and one can usually pay attention to …
In C/C++ header file stdlib.h there is a function strtol which will convert given string to a long int at the specified base. The function prototype takes three parameters. The first parameter …
C/C++ is powerful because of pointers. The pointers are used to represent the address of some memory locations. Pointers can be involved in arithmetic operations, for example, int *p; …
Polish notation/expression is also known as ‘prefix notation’ where the numbers are preceded by its operator (placed in the front). For example, “3 * 5” transformed to polish notation …
Given a string that consists of words (non-space characters count as part of a word), you are required to output the new sentence that reverses the words. For example, …