C++
- 31 March
Write String to File in C++
The files are used to store the data permanently on a disk. This mitigates the problem of loss of data when the program stops execution. On the other hand, strings are the most common data type to store the text data in C++. This article discusses methods to write string to file in C++. Using […]
- 23 March
Print Array in C++
An array is a data structure that stores similar data items at contiguous memory locations under one variable name. The elements in an array can be accessed using indices. This article discusses the arrays and how to print array in C++. Introduction of Arrays For a small number of data items, you can use different […]
- 23 March
Print Vector in C++
This article discusses the vector and how to print vector in C++. Vectors are similar to dynamic arrays in that they can resize themselves automatically when an element is added or removed. The container automatically handles the size of the vector. Elements in a vector are stored in contiguous memory locations. You can traverse these […]
- 18 March
Write Vector to File in C++
This article discusses different methods to Write Vector to File in C++. Vectors in C++ are sequential containers similar to arrays. However, vectors need to have a fixed size. On the other hand, files facilitate the storage of data permanently to the disk, therefore, mitigating the data loss even after the program stops execution. Write […]
- 15 March
Print Map in C++
Maps in C++ store the data in form of key and value pairs. Each value is identified by a key and no two keys are the same. Maps are widely used in problems that involve searching large data such as a database, cache applications, data compression, etc. This article discusses the two different types of […]
- 14 March
Write Binary Files in C++
In this post, we will see how to write binary files in java. The binary files are similar to the text files however the content in binary files is stored in binary format rather than simple text format. The binary files can come in handy for storing complex objects such as structures, and classes. This […]
- 17 February
Read File Line by Line in C++
C++ is a multi-domain programming language. It is widely used in embedded systems, game development, operating systems, etc. Therefore, we often come around situations where we need to read input from a file. Files are a great way to store the data permanently on the hard disk which is otherwise lost if the program exits. […]
- 16 February
Remove Last Character From String in C++
C++ is one of the most widely used programming languages. While programming in C++, we often come across text data. To represent text data in C++, we use string data type or an array of characters. In this article, we will discuss different ways to remove the last character from a string in C++. We […]
- 10 February
Catch All Exceptions in C++
In this article, we will see how to catch all exceptions in C++. Exception Handling in C++ An exception is an error condition that occurs when a program is running and causes it to crash. It can be due to accessing an out of index element from an array, dividing a number by 0, and […]