What is C++: Definition and 812 Discussions

C++ () is a general-purpose programming language created by Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significantly over time, and modern C++ now has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation. It is almost always implemented as a compiled language, and many vendors provide C++ compilers, including the Free Software Foundation, LLVM, Microsoft, Intel, Oracle, and IBM, so it is available on many platforms.C++ was designed with an orientation toward system programming and embedded, resource-constrained software and large systems, with performance, efficiency, and flexibility of use as its design highlights. C++ has also been found useful in many other contexts, with key strengths being software infrastructure and resource-constrained applications, including desktop applications, video games, servers (e.g. e-commerce, web search, or databases), and performance-critical applications (e.g. telephone switches or space probes).C++ is standardized by the International Organization for Standardization (ISO), with the latest standard version ratified and published by ISO in December 2020 as ISO/IEC 14882:2020 (informally known as C++20). The C++ programming language was initially standardized in 1998 as ISO/IEC 14882:1998, which was then amended by the C++03, C++11, C++14, and C++17 standards. The current C++20 standard supersedes these with new features and an enlarged standard library. Before the initial standardization in 1998, C++ was developed by Danish computer scientist Bjarne Stroustrup at Bell Labs since 1979 as an extension of the C language; he wanted an efficient and flexible language similar to C that also provided high-level features for program organization. Since 2012, C++ has been on a three-year release schedule with C++23 as the next planned standard.

View More On Wikipedia.org
  1. L

    C/C++ Best resources to learn C++ (free)

    Hi, I'm currently trying to learn the C++ programming language to build my apps in my off time. I already have Code Blocks with WXWidgets installed also. I recently heard of firecode.io. I'm looking for more resources like that ideally to learn software development (C++).
  2. S

    C# Loops to compare many rows between 2 worksheets in C#?

    Hello All, I took it upon myself to create a tool for my job that xref 2 excel worksheets on 2 different workbooks. Customers send us parts and they're wanting the leadtimes for them. We have a weekly report that has all part numbers with their leadtimes. My goal is to create a GUI in C# that...
  3. M

    C/C++ Running a C++ code from oomph-lib (a CFD software)

    Hi PF! I recently installed the computational fluid dynamics software oomph-lib, which is similar to OpenFOAM. After installing, I'm trying to run a tutorial provided with the program, described here. I think all I need to do it run the .cc file here, so I type into the terminal >> gcc...
  4. L

    C/C++ How to download LLVM/Clang C++ Compiler on GhostBSD?

    Hi, I recently installed GhostBSD on to one of my desktops. I want to use this GhostBSD machine for software development/coding. Obviously I want to program in C++ and I'm currently trying to download the clang compiler for BSD but it's being weird. I looked it up on YouTube but there weren't...
  5. LCKurtz

    C/C++ Efficient Array Initialization in Visual C++ for a 4-Digit Odometer

    Let's say you have a 4 digit "odometer" using just the digits 0 through 7. So it starts at 0000 and works its way up to 7777. So, for example, the next reading after 0007 is 0010 etc. There are ##8^4 = 4096## readings before it rolls over. I want to create and initialize an array with ##4096##...
  6. adamaero

    Compiles, and motor driver shields work individually--but not together

    I don't have a debugger yet, but my company is getting one... In the mean time, I've been un/commenting out parts of Mbed's code. Their Hello World program is available from this website, and it can be used directly in their online IDE by clicking "Import Program"...
  7. JayZ0198

    Multipurpose software that keeps C, Python, DSP, .... in the same file

    I’ve been looking for a certain type of software that can host programming (preferably C or Python) and other process that I’m going to need such as DSP, DSP filters, diagrams (3D graphs, charts,…), and text editing within the same file. It’s mainly so that I can incorporate and use each one...
  8. Superposed_Cat

    C/C++ Kill all parents child threads from a child thread in C++

    I have a C++ program that starts two threads from the parent thread, I need to kill both children from a child thread. ____> b | a - |_____> c I need to kill b & c from b. Issue is, I can't use simple flags, as c waits for input using cin. Any help appreciated.
  9. CLINTON

    C/C++ Computer programming -- Help with upcoming C++ exam

    Hi, I am an undergraduate Physics student and i have an exam on c++ programming next monday, what are the basic things I have to know in order to perform well in the exam? And how is c++ applied in physics?
  10. E

    Comp Sci Using C++ to find the minimum number of something

    I attempted going with c++ and this is what i got: #include <iostream> Using namespace std; int i, j, keeper, n; int Ingredients[100], Blender[100], cout<<”How many ingredients does the shake need?”<<endl; cin>>n; cout<<”Type down the ingredients:”<<endl; for(i=1; i<=n; i++) {...
  11. Z

    C/C++ How do I convert C++ statements to C?

    I have following C++ statements: ifstream inFile; inFile >> num_rows; file_buffer.resize(num_rows); I have converted them into C: FILE* inFile; inFile = fopen(argv[1], "r"); fgets(strNum_rows, 20, inFile); num_rows = atoi(strNum_rows); But I can't...
  12. C

    C/C++ Maximising a convolution in C++ via a GSL routine

    Consider an integral of the form $$\int_{-1}^1 dx f(x)g(x).$$ I'd like to use https://www.gnu.org/software/gsl/doc/html/min.html to find the maximum of the convolution ##f(x)g(x)## in the domain ##x \in [-1,1]##. The method initiates via a double function with parameters x and a void params...
  13. J

    Comp Sci How do you read two files in the same program in C++?

    My matrix text files can vary from 1x1 to 10x10 (Another file will be given when the code gets tested but it's all square matrices) I'm stuck here. #include <iostream> #include <fstream> #include <string> using namespace std; int main() { const int MAXI = 10; int x, y, z...
  14. J

    Comp Sci How to Read and Process Char+Number Data in C++ from a Text File?

    Hello, the text file I'm trying to read is formatted as below: x y z point1 number number number I have used getline to discard the first...
  15. J

    Comp Sci Computing the Length & Area of a 3D Triangle

    I have computed the total length of a 3D triangle and its area. The code is shown below. I want to use file output instead of cout. The file name, cw2task1output, was just given as part of the task, in this case should I make an empty text file named cw2task1output then attach it to the resource...
  16. davidfur

    MPI parallel code speed-up sucks

    Hey guys, I parallelized my code, written in C++, with the MPI library. Unfortunately, the speed-up I get saturates at x6, with increasing number of cores. Whereas, in theory, the speed-up should really be nearly linear. To understand where the bottlenecks come from, I drilled down the code to...
  17. M

    Dynamic Programming - Restoring white space between words in a file

    All the white space among words in a text file was lost. Write a C++ program which using dynamic programming to get all of the possible original text files (i.e. with white spaces between words) and rank them in order of likelihood with the best possible runtime. You have a text file of...
  18. J

    Comp Sci C++ Opening a txt file using argc and argv

    Homework Statement I have a complete code that calculates distances between point 1(x1,y1,z1) and other points(from 2nd up to more than 100) and the nth point that results in minimum distance and the minimum distance between point 1 and nth point. The code is below. The code is 100% correct...
  19. J

    Comp Sci C++ Reading Data File: Calculating Distances and Finding Closest Point

    Homework Statement I have successfully opened and discarded the headers. Then I calculated the distances between point 1 and others and the minimum distance as well. However, I am not sure how to make the code work for more than 4 points. The attached text file is what I am trying to read and...
  20. J

    Comp Sci C++ program to read an input file with multiple headers

    Homework Statement Write a program that can read an input file with a simple header. The Attempt at a Solution #include <iostream> #include <fstream> using namespace std; int main() { ifstream inFile; inFile.open("Data"); //Check for error if (inFile.fail()) { cout...
  21. S

    C/C++ C++ BBQ Threading: Implementing Dynamic Speed Control

    Here is the description of what I am working on. I wasn't able to figure it out during the semester but now that I have some time off during the break, I'd like to figure it out. implement a bounded buffer queue (BBQ) , where lock variable is used to synchronize the access of queues. 20...
  22. YoungPhysicist

    Using cin to Read Integers in Formation a@b in C++

    if I want to read to integer a and b and they are in a formation of a@b, I CAN SIMPLY USE scanf(%d@%d,&a,&b) to read the input. But how should I do that in c++(with cin)?
  23. SchroedingersLion

    Setting up an FCC lattice in a simulation

    Greetings, for a Monte Carlo simulation of N hard spheres, I want to set up the initial configuration as a fcc lattice. I am thinking about how to do it most efficiently. Here is the lattice structure: The 3 lattice vectors, each one pointing to a different type of the 12 nearest neighbors...
  24. B

    Efficient 2D Array Switch Algorithm for Lights Off in n x m Rooms | C++ Function

    Homework Statement A house has n x m rooms (n and m natural numbers, n>=2 and m>=2) and is represented as a 2 dimensional Array with n rows(0 to n-1)and m columns(0 to m-1).The room at line i( 0 <= i <= n-1) and column j ( 0 <= j <= m-1 ) is identified by the pair of numbers (i,j).All rooms...
  25. dafer45

    C/C++ Quantum transport using the C++ library TBTK

    Hi, I'm working on a C++ library for second-quantized models called TBTK (https://github.com/dafer45/TBTK). To make it easy for people to get started using the library, I have recently begun implementing solutions to the exercises in the book "Quantum transport: Atom to Transistor, S. Datta...
  26. S

    C/C++ How to use C++ in studying calculus

    How to use C++ in studying calculus I'm having a hard time.
  27. AlvisPrabhu

    C/C++ Is C++ Still Relevant in Today's Corporate World?

    Is c++ even used nowadays? I'm am currently learning it in school and I wonder if it's used in the corporate world.
  28. levadny

    C/C++ C++ Builder / RAD Studio Embarcadero

    Hello All! Anybody uses C++ Builder / RAD Studio Embarcadero? For me I used Embarcadero products on work for all project. For me interesting information of used Embarcadero in other countries. Thanks.
  29. Chromatic_Universe

    C/C++ Need Help with Monte Carlo Algorithms in C++?

    I would like to discuss code for hit and miss monte carlo methods, and also monte carlo with veto algorithm in C++. Since I am coding in C++ after a long time, I am messed up with syntax too. I have a specific set of problems to work with. If interested we can start working on it here.
  30. D

    Comp Sci Working with classes and vectors in C++

    Homework Statement Write a BinaryTree Class using these specifications: A Class Node represents a standard node of the tree with fields and a constructor like given below: int start, end; const Complex* value; //I will provide more information about Complex later because that was the...
  31. I

    C/C++ What should I be most familiar w/for C++ Data Structs & Algorithms

    Hey all, This coming Spring semester (starts in 6 weeks), I will be taking C++ Data Structures and Algorithms at my University. I started programming at University, so my experience is very limited (I've taken 3 programming courses, 1 in Python, 2 in C++). Topics we've covered in C++ were...
  32. R

    Comp Sci Velocity Verlet applied to solar system with C++

    Homework Statement Hello, I am attempting to use the velocity Verlet algorithm of integration applied to the solar system in c++. My goal is be able to use the outputted position components in a plot to see if the trajectory of my object is elliptical/parabolic/hyperbolic resulting from the...
  33. D

    Algorithm to matrix product MSR format

    Hi everybody, I'm writing some algebra classes in C++ , Now I'm implementing the modified sparse row matrix , I wrote all most all of the class, but I didn't find the way saving computing time to perform the product of two Modified sparse row matrix .. if you don't know it you can read in the...
  34. D

    C/C++ Question about a specific class method in C++

    Create a class DecimalN which holds decimal numbers using dynamic arrays. Implement a constructor DecimalN::DecimalN(char* decimal) so that it can be created like for example DecimalN number("23.5698"). Create two class functions (methods) that given the number n it shift the number n places...
  35. D

    Comp Sci Using a custom constructor in a C++ class

    Homework Statement I am quite new to C++. I have completed my C course and am now taking a C++ course at my college. The first problem i encountered is with classes and custom made constructors. In the first part of the problem I am supposed to create a class with a field which is a dynamic...
  36. E

    Comp Sci How Can C++ Function Overloading Simplify Gravity Calculations?

    Homework Statement [/B] Write a function fForceOfGravity, with return type double and with two double parameters for mass (m) and gravity (g). Parameter gravity must be initialized to 9.81. The force of gravity is given by the formula F=mg. Call these functions in the main () as follows: cout...
  37. C

    Comp Sci How to debug an infinite loop in a C++ program using fork gymnastics?

    This is what I did but I'm getting an infinite loop of the reversed string whenever I run the program. I don't know why #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> /* for fork() and getpid() */ #include <sys/types.h> #include <iostream> using namespace std...
  38. J

    C/C++ Java vs wxWidgets or GTK+ with c++ for a PC ground station

    I've got experience with win32API but its' a pain in the ass. What else is good for cross platform low level programming of apps, want it to work for PC, linux, be able to handle serial data streams, convert data and do C++ tier things. So far been using processing but that's not powerful...
  39. S

    Delete File Contents by Roll Number | C++ Code for Deletion

    ok i wrote my code but the whole file gets deleted instead of the required values. else if(option==5) { int rno; fstream w1;fstream e1; e1.open("temp.dat",ios::in|ios::out|ios::binary)...
  40. E

    Write a function that will find a temperature....

    Hi everybody, I seem to be having trouble coding a function that returns the integer value at which degrees celsius is equivalent to degrees fahrenheit. Here is the question: Write a function that will find a temperature that is the same in both Fahrenheit and Celsius. First define two...
  41. C

    Comp Sci Book Database Implementation C++

    I began by creating 2 classes. A book class and a course class that contains any necessary info about the book and course respectively class bookClass{ private: string theISBN; string thebookName; string thebookAuthor; double thebookCost; int...
  42. KonaGorrila

    C/C++ Suggested books to supplement learning C and C++ programing?

    Aloha, I am wanting to teach myself C and C++ programming languages and before I purchase any books or materials on the subject. I would like to see if anyone has any recommendations?, and the pros and cons if any, ect.
  43. M

    C/C++ Velocity Verlet C++ implementation

    I have been working on implementing a solar system system simulator in C++ - but am getting incorrect results on the order of 10^10 km, and it seems that the planets are moving directly away from the sun. I suspect that there is a mistake in the integrator (Velocity Verlet) that I have posted...
  44. Fabio Kopp

    How to integrate when one of the limits is a variable?

    I'm trying to integrate a simple function (x*y) using the Romberg method. Question 1: I want to integrate only x and maintain the argument y present in the rest of calculation, like a global variable. In fortran 77 I would use common. Question 2: How to integrate using arguments in the...
  45. Vitani11

    Comp Sci Help with coin game C++ assignment?

    Homework Statement Here is the prompt: Write a program that does the following: Welcome the user to the game and ask them if they want to play. They should type y or n for yes or no. Store this value in a char variable. If they type y, continue on with the game. If they type n, print the...
  46. Const@ntine

    Comp Sci C++ Cylinder Area Homework: Find & Program Solution

    Homework Statement Find the are of the cylinder, by creating a program in C++. 2. The attempt at a solution So far I have: #include <iostream> using namespace std; const double PI = 3.14159; class point { protected: int x; int y; public: point() { } point (int xvalue...
  47. The_Inventor

    C/C++ Creating a simple password program in C++

    So I'm trying to teach myself C++ programming and I'm having trouble writing a password program. Essentially I want to program to ask the user to input a password, and then compare that input with the correct password. If the user input matches the password I want the program to output a message...
  48. N

    How to add confg file to allow UHD drive set priority?

    I have Ettus B210 and trying to add 1 line configuration file "/etc/security/limits.conf" which will allow UHD drive to set priority. So , I typed this command to edit file: gksudo gedit /etc/security/limits.conf and add: #@student hard nproc 20 #@faculty soft...
  49. O

    C/C++ C++ Primer or PPP Stoustrup: Which Book is Better for Beginner Programmers?

    Hey everyone, I've been looking to get another C++ book. I'm currently using Gaddis Control Structures through Objects (required at my university). However, I find sometimes their explanations are poor or their examples are too long to really illustrate the point they're trying to make (e.g. a...
  50. Const@ntine

    Comp Sci C++: Method of Minimum Squares used for System Solving

    Homework Statement Okay, this one is a bit big, and I'm attempting a translation, so I'm going to post a TL;DR version at the bottom just to be sure. Anyway, here goes: While doing an experiment, we write down the values of a physical/natural size y, for various values of a physical/natural...
Back
Top