C++ contains different data types which include integer, character, float, double, arrays, etc. When we declare a variable of one data type, it can hold the data of its own type only. For example if we declare an integer type variable, we can input only an int value in it. Similar is the case with other types. But what would happen if we insist upon storing a character in an integer variable? So let us see.
Posts Tagged ‘cprogramming’
One of the most powerful features C++ language offers is typecasting or type conversion. As we have seen the basics of most of the things, so before we move on, it is imperative that we know what typecasting really is. Type Casting is actually the conversion of one data type into another one. This feature is very powerful, and yet at the same moment, very dangerous, and is systems way of dealing with various data types.
Two weeks ago, I explained to you a basic and easy sorting algorithm which was Selection Sort. Moving onwards, there is yet another basic algorithm by the name of Bubble Sort. It is known as Bubble sort because it brings the small values on the top of the list just like the light bubbles in water tend to come to the surface. Let us see how it works in depth.