Conditional compilation and conditional inclusion of a resource!

Hope you’ve heard of conditional compilation. Conditional compilation simply means what it says, i.e. compile only when a certain condition is true and it’s only meant for the compiler hence it should only take place during compilation. We do conditional compilation with help of preprocessor commands. For eg: [sourcecode language=’cpp’]void WhoIsNibu() {     // 😉 […]
Continue reading…

 

Print substrings using printf

We can use printf and it’s family of functions to print substrings, real nice. Have a look [sourcecode language=’cpp’]char* pStars = “***************”; int nStarLength = strlen( pStars ); while( nStarLength ) {   –nStarLength;   printf( “%.*sn”, nStarLength, pStars ); }[/sourcecode] ‘*’ will be replaced by value of nStarLength. Number after ‘.’ specifies length of […]
Continue reading…