How to return an Array from a function in C++
Learn how to return old C style array from a function in C++.
How to return an Array from a function in C++ Read More »
Learn how to return old C style array from a function in C++.
How to return an Array from a function in C++ Read More »
This tutorial will discuss about a unique way to pass an array by reference to function in C++. Many times, we encounter a situation, where we need to pass a fixed size array to a function. For that we need to pass two data points in the function, Although, we can pass the array as
Pass an Array by reference to function in C++ Read More »
In this article, we will learn about a STL Container std::array<> in C++. We will discuss its usage details with examples, and understand how its different from an old C style array. What is std::array<>? The std::array<> is a STL Container, and it is similar to the C style fixed size array. It can store
C++ std::array – STL Tutorial Read More »
This tutorial will discuss about a unique way to convert char array to double or number. In C++, the string.h header file provides a function stod(). It accepts a character pointer as an argument, and interprets its contents as a floating point number. It returns a double value. We can use this function to convert
Convert Char Array to Double or Number in C++ Read More »
This tutorial will discuss about a unique way to convert char array to an integer. In C++, the string.h header file provides a function stoi(). It accepts a character pointer as an argument, and interprets its contents as an integer value. It returns an int value. We can use this function to convert a char
Convert Char Array to an integer in C++ Read More »
This tutorial will discuss about a unique way to check if char array is a number in C++. We can try to convert the char array to a double value. If we are successful in conversion, then it means we can convert a char array to double. We can use the stod() function to convert
Check if Char Array is a Number in C++ Read More »
This tutorial will discuss about a unique way to initialize a char array in C++. We can initialze a char array with a string while defining the array. Like this, But we need to make sure that the array is big enough to hold all the characters of string. Otherwise you will get compile error.
How to initialize a Char Array in C++? Read More »
This tutorial will discuss about a unique way to check if two char arrays are equals. We can use the strcmp() function to compare two char arrays. It accepts two strings (char pointers) as arguments, and compares both the strings alphabetically. If both the strings are equal then it will return 0. So, to check
Check if two char arrays are equals in C++ Read More »
This tutorial will discuss about a unique way to check if char array starts with a string. To check if a char array starts with another string or char array, we can follow the following steps, Let’s see the complete example, Output : Summary Today we learned about several ways to check if char array
Check if Char Array Starts with a string in C++ Read More »
This tutorial will discuss about a unique way to check if char array contains a char in C++. To check if a char contains a specific character, iterate over all the characters of char array and check if any character matches with the given character. As soon as a match is found, break the loop
Check if Char Array contains a char in C++ Read More »