C++ Programming Articles

C++ (C-plus-plus) is one of the world's most popular programming languages. C++ is a general-purpose programming and coding language and it is commonly used in developing browsers, operating systems, and applications, as well as in-game programming, software engineering, data structures, etc. It remains in high demand amongst professionals, such as software developers, game developers, C++ analysts, and backend developers, etc. Certainly, C++ is known to be one of the most difficult programming languages to learn over other popular languages like Python and Java.

The following articles are the newest and most popular questions about the C++ programming language.

1. How to Fill an Array With Random Values from a Range

2. How to Determine Opencv Version

3. How to Take Input to an Array With Unknown Number of Elements

4. How to Determine the Highest and Lowest Value Using Do While Loops

5. How to Have All the Inputs on the Same Line C++

6. How to Execute a Command and Get the Output of the Command Within C++ Using Posix

7. Print Heart Shape With Words Inside

8. Count How Many Times Elements in an Array Are Repeated

9. How to Get Installed Windows Sdk Version

10. Get Current Time in Milliseconds, or Hh:Mm:Ss:Mmm Format

11. Fastest Way to Check If a File Exists Using Standard C++/C++11,14,17/C

12. How to Split an Int into Its Digits

13. Invalid Operands Error for Addition and Integer Division

14. How to Align Text to the Right Using Cout

15. C++ High Performance File Reading and Writing (C++14)

16. Vector of Structs Initialization

17. Checking the Neighbour Values of Arrays

18. Method That Converts Uint8_T to String

19. Writing a Sequence of Numbers Like: 1 22 333 4444 55555

20. How to Read in User Entered Comma Separated Integers

21. What Does the Single Ampersand After the Parameter List of a Member Function Declaration Mean

22. The Definitive C++ Book Guide and List

23. What Is an Undefined Reference/Unresolved External Symbol Error and How to Fix It

24. Why Is "Using Namespace Std;" Considered Bad Practice

25. Why Can Templates Only Be Implemented in the Header File

26. Why Is Iostream::Eof Inside a Loop Condition (I.E. 'While (!Stream.Eof())') Considered Wrong

27. What Is the Rule of Three

28. What Are the Basic Rules and Idioms For Operator Overloading

29. Can a Local Variable'S Memory Be Accessed Outside Its Scope

30. Why Should I Not #Include <Bits/Stdc++.H≫

31. What Is Object Slicing

32. Undefined, Unspecified and Implementation-Defined Behavior

33. What Are the Rules About Using an Underscore in a C++ Identifier

34. Undefined Behavior and Sequence Points

35. Why Aren't Variable-Length Arrays Part of the C++ Standard

36. What Is Array to Pointer Decay

37. What Is the Strict Aliasing Rule

38. What Should Main() Return in C and C++

39. How to Profile C++ Code Running on Linux

40. Why Does Std::Getline() Skip Input After a Formatted Extraction

41. When Should I Write the Keyword 'Inline' For a Function/Method

42. Calling Virtual Functions Inside Constructors

43. When a Function Has a Specific-Size Array Parameter, Why Is It Replaced With a Pointer

44. How to Get the List of Files in a Directory Using C or C++

45. Can Num++ Be Atomic For 'Int Num'

46. C++ Matrix Class

47. Accessing Inactive Union Member and Undefined Behavior

48. When Does Invoking a Member Function on a Null Instance Result in Undefined Behavior

49. Difference Between Public, Private, and Protected Inheritance in C++

50. Is Segmentation Fault Actual Undefined Behavior When We Refer to a Non-Static Data-Member

51. Difference Between 'Struct' and 'Typedef Struct' in C++

52. What Does the Explicit Keyword Mean

53. Regular Cast Vs. Static_Cast Vs. Dynamic_Cast

54. Cout << With Char* Argument Prints String, Not Pointer Value

55. Strange Output in Comparison of Float With Float Literal

56. What Is the Curiously Recurring Template Pattern (Crtp)

57. Definitive List of Common Reasons For Segmentation Faults

58. Boost Spirit: "Semantic Actions Are Evil"

59. Single Quotes Vs. Double Quotes in C or C++

60. C++ Delete - It Deletes My Objects But I Can Still Access the Data

61. What Is the Proper Declaration of Main in C++

62. Order of Evaluation in C++ Function Parameters

63. How to Add "-L" (Ell) Compiler Flag in Cmake

64. What Is "Rvalue Reference For *This"

65. How to Remove Code Duplication Between Similar Const and Non-Const Member Functions

66. Meaning of Acronym Sso in the Context of Std::String

67. What Are the Evaluation Order Guarantees Introduced by C++17

68. Derived Template-Class Access to Base-Class Member-Data

69. Finding Current Executable'S Path Without /Proc/Self/Exe

70. If You Shouldn't Throw Exceptions in a Destructor, How to Handle Errors in It

71. Thou Shalt Not Inherit from Std::Vector

72. Post-Increment and Pre-Increment Concept

73. What Is External Linkage and Internal Linkage

74. How to Enable C++11/C++0X Support in Eclipse Cdt

75. Is It Better in C++ to Pass by Value or Pass by Reference-To-Const

76. Case-Insensitive String Comparison in C++

77. How to Reverse a String in Place in C or C++

78. Why Are Preprocessor Macros Evil and What Are the Alternatives

79. How to Print a Variable'S Type in Standard C++

80. In Which Scenario Do I Use a Particular Stl Container

81. Implementation C++14 Make_Integer_Sequence

82. Why Don't I Get a Segmentation Fault When I Write Beyond the End of an Array

83. Std::Enable_If to Conditionally Compile a Member Function

84. What Is the Bit Size of Long on 64-Bit Windows

85. Is "Delete This" Allowed in C++

86. Convert a String in C++ to Upper Case

87. Choice Between Vector::Resize() and Vector::Reserve()

88. Replace Part of a String With Another String

89. How Do Inline Variables Work

90. Placement of the Asterisk in Pointer Declarations

91. Operator< and Strict Weak Ordering

92. Why Pow(10,5) = 9,999 in C++

93. Unnamed/Anonymous Namespaces Vs. Static Functions

94. Is Meyers' Implementation of the Singleton Pattern Thread Safe

95. Are Std::Vector Elements Guaranteed to Be Contiguous

96. Object Array Initialization Without Default Constructor

97. Why Does Changing 0.1F to 0 Slow Down Performance by 10X

98. What Does T&& (Double Ampersand) Mean in C++11

99. C++11 Rvalues and Move Semantics Confusion (Return Statement)

100. Why Use Pointers

101. Is It Safe to Delete a Null Pointer

102. Convert Python Program to C/C++ Code

103. How to Detect Reliably MAC Os X, Ios, Linux, Windows in C Preprocessor

104. What Happens to Global and Static Variables in a Shared Library When It Is Dynamically Linked

105. Multithreading Program Stuck in Optimized Mode But Runs Normally in -O0

106. How to Output Coloured Text to a Linux Terminal

107. How to Get Memory Usage At Runtime Using C++

108. How to Use C++ in Go

109. How to Forward Declare an Inner Class

110. Atomic Double Floating Point or Sse/Avx Vector Load/Store on X86_64

111. Is Multiplication and Division Using Shift Operators in C Actually Faster

112. C/C++ Check If One Bit Is Set In, I.E. Int Variable

113. Best Compiler Warning Level For C/C++ Compilers

114. Is the 'Override' Keyword Just a Check For a Overridden Virtual Method

115. What's a Very Easy C++ Profiler (Vc++)

116. C++ How to Use Select to See If a Socket Has Closed

117. .O Files VS .A Files

118. Regex Replace with Callback in C++11

119. Register Keyword in C++

120. How to Install the Openssl Libraries on Ubuntu

121. How to Avoid the Diamond of Death When Using Multiple Inheritance

122. Variadic Function Template with Pack Expansion Not in Last Parameter

123. C++11: How to Alias a Function

124. Linux Allocator Does Not Release Small Chunks of Memory

125. Global Scope VS Global Namespace

126. Splitting a String by a Character

127. Why Are Redundant Scope Qualifications Supported by the Compiler, and Is It Legal

128. Is Std::Vector Copying the Objects with a Push_Back

129. M_Pi Works with Math.H But Not with Cmath in Visual Studio

130. Identifying Primitive Types in Templates

131. Constant Expression Initializer for Static Class Member of Type Double

132. C++ Templates Specialization Syntax

133. C++11 Equivalent to Boost Shared_Mutex

134. Near and Far Pointers

135. Alternative Function in iOStream.H for Getch() of Conio.H

136. How to Export Templated Classes from a Dll Without Explicit Specification

137. Array VS Vector VS List

138. Compiling with -Static-Libgcc -Static-Libstdc++ Still Results in Dynamic Dependency on Libc.So

139. How to Access Private Data Members Outside the Class Without Making "Friend"S

140. Why Doesn't Vector::Clear Remove Elements from a Vector

141. Treating Memory Returned by Operator New(Sizeof(T) * N) as an Array

142. Mouse Program in Turbo Cpp

143. Writing Function Definition in Header Files in C++

144. Is There Any Lame C++ Wrapper\Simplifier (Working on Linux MAC and Win from Pure Code)

145. How to Align Pointer

146. Since I Can't Return a Local Variable, What's the Best Way to Return a String from a C or C++ Function

147. Uses for Negative Zero Floating Point Value

148. Wrote to a File Using Std::Wofstream. the File Remained Empty

149. How to Use Dynamic Name for Variables in C++

150. How to Create a Template Function Within a Class? (C++)

151. Explicit Return Type of Lambda

152. Best Library for Statistics in C++

153. What Is the Safe Way to Fill Multidimensional Array Using Std::Fill

154. Why Don't Std::Vector's Elements Need a Default Constructor

155. Incrementing Iterators: Is ++It More Efficient Than It++

156. Does Std::Cout Have a Return Value

157. Can an Integer Be Nan in C++

158. Strange "Unsigned Long Long Int" Behaviour

159. What Happens When a Function That Returns an Object Ends Without a Return Statement

160. How to Change Text or Background Color in a Windows Console Application

161. C++ Standard Practice: Virtual Interface Classes VS. Templates

162. The Difference Between Delete and Delete[] in C++

163. Why Is Arr and &Arr the Same

164. How to Install/Configure Opencv3.2.0 with C++, Visual Studio 2017

165. C++ Range/Xrange Equivalent in Stl or Boost

166. How Are Objects Stored in Memory in C++

167. Differencebetween Wmain and Main

168. How to Get Process Handle from Process Id

169. Should "Delete This" Be Called from Within a Member Method

170. Boost.Python Call by Reference:Typeerror: No To_Python (By-Value) Converter Found for C++ Type:

171. C/C++: Casting Away Volatile Considered Harmful

172. Qt Equivalent of Pathappend

173. Gsoap Multithreading

174. Create 2D Array Using Size from Parameters in C++

175. Memory Model Ordering and Visibility

176. Portability of Native C++ Properties

177. G++: in What Order Should Static and Dynamic Libraries Be Linked

178. What Exactly Is Va_End For? Is It Always Necessary to Call It

179. C++11: Std::Thread Pooled

180. Why Can't I Put a Variable Declaration in the Test Portion of a While Loop

181. How to Set the Background Image in Qt Stylesheet

182. C++: What Is the Printf() Format Spec for "Float"

183. Findwindow Does Not Find the a Window

184. Why Doesn't the Program Crash When I Call a Member Function Through a Null Pointer in C++

185. How to Find The Full Path of The C++ Linux Program from Within