This chapter will discuss the various ways we can declare or deduce the return type of a template function. We can use either template or…
In the previous chapter, we had a brief encounter with function templates. In this chapter, we will learn how to implement a function template. We…
C++ templates are intimidating for any beginner or intermediate level programmer as it is syntactically a bit cryptic and complex. Also, there are intricacies in how to use the powerful features of the language. A standard C++ book does not always go into the feature’s details instead of just touching upon the subject, which is not sufficiently explanatory for the first-time learners. Sometimes the examples are too complicated, or the explanations are too vague to understand. Often, there are not many different sample codes to practice enough to have a good grip on the subject. In other cases, the available books go so deep into the nitty-gritty of the language that the reader feels a bit lost in the sea of information. In either way, the subject seems daunting for the newbies or intermediate-level programmers. However, if we explain it systematically with simple examples and easy-to-understand explanations, the C++ template could be a powerful tool for programmers. Proper use of templates can lead to clean, elegant, and efficient code on many occasions. The reader should be a beginner or intermediate-level programmer who has a basic understanding of C++ programming. They do not need to have detailed, in-depth knowledge or vast experience on the subject but should be familiar with the C++ programming paradigm’s basic concepts and be looking to take it to the next level.
This blog is about how to launch a Linux shell command inside a C++ program.
Operator overloading is one of the fundamental operation which come across often in a C++ program. It is bit cryptic in syntactical side as well as often a misunderstood topic amongst new programmer. I will try to explain this as a series of C++ related notes (as I like to call this) following this post.
I do not have administrative rights on a linux server (openSuse Linux) I am working on right now. So installing anything is not an option…
valgrind is a popular tool which can detect memory in run-time. This blog post discusses how to install, and run valgrind at linux command line to detect memory leak in a sample C program.
This blog post discusses the polymorphism with the help of C++ language. The mechanism to implement polymorphism in C++ is known as Virtual Functions. With the help of a simple example I will try to explain the concept as clearly as I can.
Why virtual functions are required in C++.
This blog describes the steps to use eclipse as your linux kernel source code browser.