Topics

C++

About this topic: Articles tagged __TAG__

Showing 512 articles

Topics

Articles

Showing 512 articles

How-tos #pragma once in C++: Include Guards and Portability Prevent repeated C++ header inclusion with #pragma once or include guards, and choose the right option for your toolchain. How-tos Difference Between .cc and .cpp File Extensions in C++ Learn how to choose between .cc and .cpp C++ source files, compile either suffix with GCC, and avoid build-configuration problems when renaming files. How-tos How to Replace a Part of the String in C++ This article introduces how to replace a part of the string in C++. Learn effective methods using C++ standard library functions, including examples with std::string::replace, … How-tos How to Tokenize a String in C++ This article demonstrates how to tokenize a string in C++. Discover effective methods using C++ standard libraries like sstream and string. Learn to break down strings into … How-tos How to Convert String to Hex in C++ This article introduces how to convert string to hexadecimal value in C++. Learn multiple methods, including using loops, bit manipulation, and standard library functions, to … How-tos How to Parse a Comma Separated String Sequence in C++ This article introduces how to parse a comma-separated string sequence in C++. Discover effective methods using std::stringstream, std::string::find, and std::regex for efficient … How-tos How to Print System Time in C++ This article demonstrates how to print system time in C++. Explore various methods using the and libraries, along with custom formatting options. Learn how to effectively display … How-tos How to Use Smart Pointers in C++ This article introduces how to use smart pointers in C++. Learn about std::unique_ptr, std::shared_ptr, and std::weak_ptr, and discover how they can simplify memory management in … How-tos How to Utilize the setw Manipulator in C++ Learn how to use the setw manipulator in C++ to format your output effectively. This comprehensive guide covers the basics of setw, including aligning text, formatting numeric … How-tos How to Use the STL Stringstream Class in C++ Learn how to effectively use the STL stringstream class in C++. This article covers its functionalities, including string manipulation, conversion, and parsing, with practical … How-tos How to Use the static_cast Command in C++ This article introduces how to use the static_cast command in C++. Learn about its applications, benefits, and how to implement it effectively for type conversions in C++. Discover … How-tos How to Use the typeid Operator in C++ This article demonstrates how to utilize the typeid operator in C++. Learn about its syntax, applications with polymorphism, and type comparison. Discover practical examples and … How-tos How to Erase String in C++ This article explains how to utilize std::string::erase function in C++. Learn the different methods to erase characters and substrings from strings in C++, complete with clear … How-tos Character Input in While Loop Using C++ Learn how to take character input in a while loop using C++. This quick guide covers methods like cin, get(), and getline() for effective user input handling, making your … How-tos How to Throw Out of Range Exception in C++ This article discusses how to throw an out of range exception in C++. It covers methods for throwing and handling exceptions in C++, including using vectors and arrays. Learn about … How-tos How to Convert String to Lower Case in C++ Learn how to convert C++ std::string to lowercase with various methods. This comprehensive guide covers using std::transform, manual iteration, and locale-sensitive conversions. … How-tos How to Convert Int to Char Array in C++ This article demonstrates how to convert integer data types to character strings in C++. Explore various methods such as sprintf, itoa, and std::to_string with clear examples and … How-tos How to Convert String to Char Array in C++ This article introduces multiple ways to convert a string to a char array in C++. Learn about methods like c_str(), copy(), and using loops, complete with code examples and … How-tos How to Return an Array From a Function in C++ This article explains how to return an array from a function in C++. Learn various methods including returning a pointer to a dynamically allocated array, using std::array, and … How-tos How to Pass 2D Array to a Function in C++ This article introduces multiple methods to pass 2D arrays as function parameters in C++. Learn how to use pointers, references, std::vector, and template functions to enhance your … How-tos How to Print Out the Contents of a Vector in C++ This article introduces how to print vector contents to stdout in C++. Learn various methods such as using loops, the std::copy function, and custom functions to display data … How-tos How to Initialize a Vector in C++ This article demonstrates how to initialize a vector in C++. Learn various methods such as initializing with specific sizes, values, or from other vectors. Enhance your C++ … How-tos How to Parse String Using a Delimiter in C++ This article introduces how to parse a string using a delimiter in C++. Discover various methods including std::stringstream, std::string::find, and regular expressions. Enhance … How-tos How to Print an Array in C++ This article demonstrates methods to print out an array in C++. Explore simple loops, range-based for loops, and the Standard Template Library to effectively display array …

← All topics