What is C++: Definition and 813 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. F

    C/C++ How Can I Generate a Calendar in C++ Using User Input for First Day and Month?

    okay so they asked us to make an entire calendar where the user inputs the first day of the month and month itself and a calendar is generated for an entire year.. so far I've gotten to being able to generate a good thingi for a month.. and well I've used a while loop to repeat till the months...
  2. L

    Fixing a 'Invalid use of Member' Error in C++

    Hi guys, I was wondering if you could help me with the following: 1.I declare a class, then put public members into it. 2.Then I make member functions that return values that are computed from the values of other members. These functions would have no input, I guess, so I gave them none. I...
  3. M

    Comp Sci The AnswerCreate C++ Program for Username & Password

    c++ strings help! Homework Statement Create a C++ program that would ask the user for a username and password. Password field should be masked. If the user exceeded three errors, a string will be seen on the screen which says “ERROR” and exits the program. username: ayen_lee...
  4. S

    Creating a Wrapper Class in C++

    Can anyone give me a simple example of how to creating a wrapper class in C++? Or maybe a link to a tutorial would also do.
  5. A

    C/C++ How can I extract and print every 5 digits from a txt file using C++ file i/o?

    i have a txt file full of numbers and i just want to take the first 5 digits, save it has one number, shift over 1 digit, take another 5 digits, save it, and so on until the end of the file here is the code fstream Prime; Prime.open("digitsofe.txt"); if (!Prime.is_open()) { cout <<...
  6. F

    Comp Sci C++ program-help printing columns and rows

    C++ program--help printing columns and rows Homework Statement Print the approx of e^x from 1 to 100. It might not fit on screen so for example print out in 10 columns and 10 rows.Homework Equations int row =1; while (row < 20) { int column = 1...
  7. A

    Troubleshooting C++ Code for Data Processing in Several Files

    Hi everybody. I'm relatively new to C++ and am having an issue. What I need to do is take in several files and then do some data processing in each of them separately. I've tried to do this several ways and nothing has worked so far. Below is my last attempt. Basically, each file is...
  8. G

    C/C++ Solve Matrix w/ C++: Row-Echelon Form

    I just thought I'd post this here. It will help you solve a matrix by getting it into row-echelon form (well, close to it anyway). I avoided global variables and tried to make it as expandable as possible. #include <iostream> using namespace std; void output(int height, int width, long...
  9. H

    C/C++ Code : Binary Search Tree C++

    #include <iostream.h> #include <conio.h> #include <stdio.h> void main() { struct znode // binary search tree node { int data; // data type is integer struct znode * left; // left subtree struct...
  10. L

    C/C++ Solve C++ Program Issue: Compute Square Root & Compare Difference >50

    I'm attempting to teach myself C++, and I came across this old C++ problem in my closet. It's a ripped page and I'm not sure what book it's from so it has no solution. It's easy, but I seem to have issues with while loops. If someone would explain the logic or show me an example as to how they...
  11. N

    C/C++ C++ GUI: Find a Good Website for Help

    Hey can anyone direct me to a good website??
  12. Z

    C++ Tutorial for Beginners: Learn Programming with Zeeshan

    Hi Everyone! Does anyone here know where i could find a good C++ programming tutorial. I've always wanted to learn how to progam but i can't find a good tutorial (im only 13 years old..) if anyone knows about a good tutorial please post link here, pm me the link, or email me the link. Much...
  13. C

    C/C++ C++ Console Help: Show Output and Close on Enter Key

    #include <iostream> using namespace std; int main () { cout << "Hello World!"; return 0; } this would produce an output in the console and then closes it automatically its so fast I can't even see it, I know you can let the console display the output show and close only when you...
  14. T

    Learning C++ Programming for TI Basic Users

    i have made programs on my TI83+ than i bought a TI89+ Titanium but i have never programed in C++ or any other programming language. so could anyone tell me about how to program in C++ and the key differences between C++ and TI basic? if anyone wnats my programs contact me with youe E-mail and i...
  15. C

    C/C++ Using Gotoxy in C++ for Positioning Characters on Screen

    Is there a way I can write characters or numbers anywhere on the screen in C++ like the ones used in pascal like gotoxy where I simply write screen coordinates as x & y.
  16. C

    C/C++ Graphing Curves in C++ w/ Dev C++

    I want to graph curves in C++. I can program them in, find the x,y,z coordinates, but I don't know how to graph them. I am using Dev C++. How would I go about graphing them? Is there some predefined graphics library that I can use or is it more complicated than that?
  17. F

    C/C++ How to test input type before storing C++

    Im sure this is a very basic question. Anyways I need to test the input going to my c++ program before cin stores it. (ive basically written a very simple 4 function calculator program and i just want to make sure that my program does not fail if someone were to enter for example a letter...
  18. K

    C/C++ Finding the Right C++ Compiler Program

    Could anyone recommend a good C++ compiler program. I'd rather get a recommendation than choose from the myriad on the net. Thanks :smile:
  19. V

    Comp Sci C++ Binary Search Tree: Infix Exp. & Tree Traversal

    c++ data structures! please help! i want to write a c++ program that implements a binary search tree from an infix expression. the program should perform the following: -the expression should be saved and read from a file. -use a stack to check if the expression is well formed in terms of...
  20. L

    C/C++ C++ Version of WIMS: Find Help Here

    Hi there, sometimes ago I was browsing a Nuclear Eng. Dept. website ( I can't remember what university) and ran into a project in which somebody had converted the WIMS source code from Fortran to Object Oriented C++. Now I'm looking for a such conversion. Can anybody help me?
  21. S

    C/C++ Namespace friend functions C++

    So I have this Class Random that needs to have a friend function sort which needs to exist in two namespaces. Class Random { ... Some stuff friend void sort(Random &x); } namespace ascending { void sord(Random &x) { ... Some Stuff } }...
  22. N

    C/C++ C++ vector<vector<int> > problem

    I'm having trouble figuring out why some of my integers are behaving crazy. I have a vector of vectors, declared as vector<vector<int> > ph; In another function, I add a vector of three ints to it using vector<int> p; p.push_back(0); p.push_back(0); p.push_back(1); ph.push_back(p)...
  23. K

    C/C++ C++ Program Help: Get Sum of N Numbers w/ Pointers

    What is the program code in c++ to get the sum of given n numbers using pointers?
  24. G

    Comp Sci Using C++ to find the electric field vectors

    im not too sure if this belongs here or not but i figure ill give it a shot. Im not too bad at solving things myself, i could do this problem without C++(though it would take some time). Unfortunately, i need to use C++. Rather than try to explain what i need help with ill copy and paste...
  25. P

    C/C++ How can I tackle building a tetris game in C++ with my team?

    I'm taking an undergrad CS course, and we've been split up into teams and have been assigned a tetris game in C++. The limitations are very loose, and we can basically do it however we want. I've had 2 C++ classes and a class in Java, so I'm not that new to programming, but I am new to...
  26. M

    Comp Sci C++ storing a string in a pointer.

    Homework Statement If I write: char* Name="Computer"; cout<<Name[0]; //Output: C cout<<Name[2]; // Output: M what do the above lines mean? How can a pointer store a string? And why is it acting like an array? Either it is a simple concept that I have forgotten or it is a new concept...
  27. R

    C/C++ Solve C++ Number Probs: Find the Smallest Number with 1-9 Digits

    Hi Lets see...I got this interesting program: To Find the smallest number which when put together with its square as a single number has the digits 1-9 exactly once i.e. it does not have a 0 in it. Initial Observations: 1.The first thing to see is that the conglomerated no. should have...
  28. T

    C/C++ C++ Training Guide by Steve Heller

    I recently bought the C++ Training Guide by Steve Heller and the CD is broken. Does anyone who owns this book know whether it's necessary because for a newbie like myself I'm finding it slightly difficult to understand some of the basics. Also, I've been using cmd (and notepad) to teach...
  29. S

    C/C++ C++ Separate Digits: No Division Needed

    I don't know much of programming but i know a few things...so please be gentle on me o:) I need help (in C++) with separating the diggits of a number without using any divisions (no '%10', no '/10', etc), just something that reads the number and gives me the diggits. don't know if it helps but...
  30. malawi_glenn

    C/C++ Learning C++ - What Software do I Need?

    Hi! I want to learn C++. I know some java.. I was wondering what kind of software i need to do C++ on my computer, I have Windows vista premium. Does it exists software equvalent to BlueJ to C++ ?
  31. S

    C/C++ C++ Game Source: Mongolians Welcome!

    Сайн байна уу? Хэрвээ энд манай Монголчууд ордог бол. хэ хэ Та нар энд C++ дээр хийсэн жижиг сажиг тоглоомынхоо соорсыг энд тавьж болно шүү! Hello all. Lets putting here you c++ game source! sorry my bad english!
  32. C

    Comp Sci Solving C++ 3n+1 Problem - Max Cycle Length w/ Code

    Im trying to find the maximum cycle length, but the program hangs when i>100000 or so. Here's the code: #include<iostream> using namespace std; int main() { unsigned int i, j; int count, cmax; int process(int x); cout<<"Enter range:\nFrom: "; cin>>i...
  33. M

    Comp Sci  C++ How to declare/initialize a constant in a class?

    Homework Statement I have my computer science exam today (in 2 hours). I want to know how to declare and initialize a const member in a class. The Attempt at a Solution I tried this: _________________________________________________________________ class stu { const int a=10...
  34. Z

    Comp Sci Solving C++ Problems: Finding Numbers Divisible by 5 or 7

    1. 1. Use a do…while loop to determine the total number of numbers between 0 and 500 that are evenly divisible by 5 or 7. Output should look like this: The total number of numbers less than 500 that are divisible by either 5 or 7 is 157. Use at least 1 increment operator and 1 decrement...
  35. L

    C/C++ Why is My C++ Program for the Bateman Equation Returning NAN?

    Hello, I am attempting to create a program that will evaluate the Bateman equation for radiactive decay series, given several decay constants stored in a text file. I am not sure where this is going wrong, but no matter what chain member I enter in as the desired nuclide to find the mass...
  36. J

    Positioning Cursor in Visual C++ Console Program - Help Needed

    I want to do this (HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); if ( hConsole != INVALID_HANDLE_VALUE ) { // do stuff... ... } ) In visual c++, I generally use gotoxy() to position the http://www.seopromolinks.com/business_continuityplan.asp"...
  37. N

    C/C++ C++ Object-Oriented Assignment: Test Your Motion Knowledge

    Hi Everyone I have a object oriented C++ assignment which is due this week and I have no idea as to how start it.... This program prints a motion verb ( fly, run, swim, crawl, walk, or roll ), waits for a second, then prints the name of an entity and repeats the verb (for example: fly ..1s...
  38. C

    C/C++ How do I set up C++ on my Mac for beginners?

    Hello, For my summer project I am going to be writing some C++ code. My computer is a Mac running OS X. I really don't know where to start. I have programmed Java on my Mac previously without too many problems, although I was struggling with setting up XCode. Now with C++, which seems much...
  39. S

    C/C++ Finding a Guide to Learning C++

    I was wondering if anyone had a .pdf or any other type of file that could serve as a guide to C++. I just started and would like to learn the program so I do not have to constantly look things up. If not, could anyone suggest a good book that covers the basics/intermediate parts of C++...
  40. R

    C/C++ How to Simulate Projectile Motion in C++?

    hi I am having trouble doing this assignment. I have very little knowledge of c++ and the truth is i don't even know where to begin. Can someone please help me with it. the program I am supposed to be writing is as follows: compute the height of a projectile that was launched. You will...
  41. P

    Comp Sci Trouble Expanding an Array of pointers in C++

    Homework Statement I am working on a program that reads in names (strings), sorts them, and then later is searchable. The problem I am having is this. When I enter the first 20 elements of the array, everything works fine. When I enter the 21 element (when it goes into the if loop) I get...
  42. B

    C/C++ How Can I Adjust My C++ Sine Wave Code to Simulate Projectile Motion?

    hey. i want to graph a projectile motion. i got the code of a sine wave but the x and y axis' are in the opposite sides. i want the curve to look like a projectile with the curve facing down. thanx. here's my code #include <iostream.h> #include <iomanip.h> #include <math.h> #include...
  43. J

    Creating a Binary Matrix with C++ Code

    I want to build a binary matrix (with 1 and 0 entries) with all possible combinations, say for example if n is the number of entries of one row of the matrix, then 2^n is the total number of different entries in the matrix. For instance, for n=3, 2^n = 8, so we would have the following matrix...
  44. C

    C/C++ Fixing C++ File Program with 6 Linker Errors

    Im having a problem with a cpp program. It gives me 6 linker errors, which have something to do with buffer overflows. I used borland turbo cpp 3 to compile this. What should I do. Here's the code: #include<fstream.h> #include<conio.h> #include<stdio.h> ofstream write; ifstream...
  45. B

    Comp Sci Having Problem Graphing a projectile motion into C++

    Hey. i am having a problem graphing a projectile motion into C++. At the moment I am using the program Microsoft Visual C++ at uni. i got a problem here that i can't even start to solve. Well the problem asks me to to ask the user to enter the intial velocity and the angle at which the...
  46. K

    C/C++ I know that C++ is based on C, but what are the differences?

    I know that C++ is based on C, but I recently checked out the book https://www.amazon.com/dp/1565923065/?tag=pfamazon01-20, thinking it was a C book but now I am unsure and can hardly tell the difference between the two. Can someone help clarify what the differences are? which do you...
  47. S

    C++ / Win32 / Physics Simulation

    Homework Statement Simple Pendulum using Forces (Computer Simulation) Max theata = PI / 6 Force Of Gravity is { 0, 10 } Force_Tension.x = - 10 * sin(balls.theata); Force_Tension.y = - 10 * cos(balls.theata); Homework Equations accelleration = Force_Tension -...
  48. N

    C/C++ C++ program starting with void PrintTranscript

    void PrintTranscript( const vector <student>& a ) { cout << "Here is a list of courses that you have taken:" << endl; for (int i = 0; i<a.size(); i++) { line 104: for (int j = 0; j<a.size(); j++) cout << a[i].firstname << " " << a[i].lastname << "...
  49. G

    C/C++ How can I pass a 2D array in C++ without errors?

    1. The problem I am having is that I am trying to pass a two dimensional array from my main function to a secondary function. I know it has to be call by reference and using the name of the matrix, "matrix" in my case should send the location. Also since it has more than one dimension there...
Back
Top