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. D

    C/C++ C++ Simple File I/O: Tips & Solutions

    I'm trying to come up with a C++ program that reads input from a text file. Each line of this text file has a different variable. I have different data types (int, string, char). I'm having difficulty to read strings with spaces and read char's. The rest seems to work fine. If possible, I'd like...
  2. ranger

    C/C++ Separate Digits in C++: How to Place Spaces Between Numbers for Easier Output

    If I take a six digit number and store it in one variable, how can I place spaces between each digit at the output. This would be so much easier if each digit were stored in separate variables. --thanks
  3. N

    C/C++ Set-Variable Style Functions in C++

    Just curious if there was any difference between the following two set-variable style functions for member variables interms of effiecieny CType& Member(void) {return _member; } //Used in David Eberly's Code void Member(CType const& tp) {_member=tp); } Is there an actual difference? Also...
  4. S

    C# Visual C++ or C# is better to learn ?

    For the sake of getting job in ICT field, what shall i focus on ? C++ or C# ? :confused:
  5. Z

    Quick C++ Problem - Combining Functions for Array Output

    I'm just finishing off my C++ project and I decided when looking at two functions that they would be far more efficent as one function (because they are always used together and as it was it repeats the same code twice). Now I wanted my output as an array so I could called on the two needed...
  6. S

    C/C++ Using Complex C++ Class Header <complex>

    Hi, Has anyone here used the complex C++ class before Header <complex>? I am trying to do something VERY straightforward but there doesn't seem to be any way to do it! Basically, I define a complex, and then want to re-asign its real and imaginary parts: complex<double> A(1,1); //...
  7. F

    Comp Sci Converting Temperature Units with C++

    I know I am not a moron but this C++ is killing me, I have to write a program using functions to convert temp between c, f, k I am hung up // Mod4project2tempconvert.cpp : Defines the entry point for the console application. #include <iostream> using namespace std; double ftemp (double...
  8. F

    C/C++ Need Help With C++ Void Function: Find Max of 3 Ints (VS.NET)

    I have to answer a homework problem due today that I am not sure how to do the problem reads. "Write a program that calls a void type function to find the maximum of three given integer numbers" We use visual studio.net, any help would be appreciated and I would like to be able to compile it...
  9. Z

    Troubleshooting C++ Program: Invalid Conversion Error

    Just been introduced to the world of C++ as I'm taking a course on it in my maths degree. We are asked to write a simple program that takes in 3 numbers, sorts them in terms of order and then outputs them. Not going to type my full program as that would probably be a waste of your time but...
  10. E

    Comp Sci C++ Code: Searching for a specific string

    umm, anyone who could help me write a code wherein, given an input file, it searches for a word inputed by the user, then outputs the result (how many times it appeared in the input file) in an output file. This program also uses 2 command line arguments. The first argument is the word to search...
  11. E

    C/C++ Visual C++ vs C++: Understanding the Difference

    Umm guys, is visual c++ a very different programming language than c++. I mean, I installed a copy of visual c++ and looked at the pre-made template of hello world but saw that it is very different from the normal source code for c++. I have this code made from devcpp, the calculator if you...
  12. H

    Incorporate another function into this problem C++

    i have this problem and i am having trouble how to incorporate another function into this problem here is the problem.. #include <iostream> using namespace std; struct node { int data; node *next; }; struct node *push_front ( node *list, int data ) { node *p = new node...
  13. E

    C/C++ Catchinmg the Enter Key for c++

    Hello guys. I'm trying to do the command "PLEASE PRESS ENTER KEY TO RETURN TO MAIN MENU." The problem is that I don't know how to catch this enter key. I do know that its ascii value is 13. I tried using sscanf and getch but can't seem to make it work. void StockBroker::showAllBalances()...
  14. E

    Learning Python: Getting Started from Java and C++

    I want to start learning python. Lots of people I know say it's a very good language. Right now I know Java and a little bit of C++, but I'd like to experiment with some other languages, specifically Python. Right now I've got Python 2.4 installed on my PC, now I need to know what to do from...
  15. JamesU

    C/C++ Program to respond to commands in C++

    I want to know how I can get my program to respond to commands in C++. for instance, when someone presses the up, down, or side arrows; or when somebody clicks something.
  16. JamesU

    C/C++ Learn another language besides C++

    I want to learn another language besides C++. What would you reccomend? I was thinking BASIC, but I'm not too sure. What do you think would be good next?
  17. JamesU

    C/C++ Can Graphics be Created in C++ and Used in Source Code?

    Is there a way to create graphics in C++. or in some other language, and I can use the grphic file in the C++ source code?
  18. JamesU

    C/C++ Troubleshooting C++ Circle Area Calculation

    What's wrong with this C++ project I'm working on? it's supposed to find the area of a circle: #include <cstdlib> #include <iostream> using namespace std; int main(int argc, char *argv[]) { int pi = 3.14 int rad int radsqr = rad*rad cout << "radius of the circle:"...
  19. E

    C++ Program Ideas: Creative Solutions for You

    Umm guys, can you give me some ideas of what ptogram to create using basic c++? I've already learned arrays, pointers, classes, strings, etc. I really like to make a game but don't know what game to create. Actually, i had the idea to make a hack/cheat for microsoft's spider solitair wherein...
  20. O

    C/C++ Where to find a good C++ Compiler?

    Didn't see anything under search but does anyone know where I can get a free C++ compiler? thank!
  21. E

    Implementing Various Calculations ith only + and - in c++

    Guys, I'm starting to learn c++ and wanted to know hot to implement various operations using only + and -. I'm trying to implement *, /, %, powers, and square root. I've been experimenting with the for loop but can't seem to make it work. Any tips on how to do these? Thanks :D
  22. S

    C/C++ C++ output date in number of days per year

    for example user puts in the month as 1-12 the day for whatever month and the year, which has to include leapyears leap years only occur when the year is divisible by 4 y%4==o or if divisible by 400 but NOT 100, so 2000 is a leap year but not 2100 so if somebody puts in month 1 day 1 and...
  23. G

    Is Your C++ Character Range Check Correct?

    hi, i have a little problem i m not able to check if an input character is in a specified range of characters. i.e is this char between A and Z let s say. I tried to use the ascII but it didn t work out; no syntax errors at compile time but the error occurs at run time. this is the code i...
  24. T

    C/C++ Programming a parallelogram in C++

    I'm having troube getting my program to display a parallelogram. The source code here just displays a triangle with "6" as the speicifed size. * ** *** **** ***** ****** ***** **** *** ** * The output is suppose to be something like this: _____* _____** _____*** _____****...
  25. JamesU

    C/C++ Visual C++ 2005 Express Edition beta 2

    for anyone who owns or is familliar with 'visual C++ 2005 Express Edition beta 2' . I'm new to programming, and I don't understand how to compile. probably a stupid question, but can anyone tell me how?
  26. N

    C/C++ C++ Friend Functions: Benefits & Tradeoffs

    Sup, is there a purpose to declaring functions as FRIEND rather than as member functions of a class...types of functions I'm looking towards: Print Save Load. I'm trying to organize my code(3D engine/neural nets) and I'm looking to put those above 3 functions in a separate namespace or as...
  27. P

    C/C++ Learning C++ with Deitel: Reviews and Resources

    I have started my course of C++ basics for a few weeks, some of my friends introduce Deitel's books, can you help give some comments on his series so I can assume myself that his are good enough not to waste my money on. It looks like a dictionary to me, and well, I don't have much money...
  28. S

    C/C++ How to Create a C++ Program to Separate and Add Even and Odd Integers?

    i have to create a program to separate ANY number of integers into odds and evens and give back the sums of them seperately i'm thinking to use if i%2=0 then it is even or if i%2 is .5 then it is odd or sumthing i haven't learned much about how...
  29. R

    C/C++ Creating an exe file in visual c++

    How do you create an exe file in visual c++? I was unable to find any relavent information in the help files. I'm looking to save my program as an exe so that it can be ran on any computer by simply opening the exe file.
  30. T

    C++ check a type char variable against letters of the alphabet

    I am getting an error I cannot seem to figure out. whenever I try to compile it, it says c is undeclared. I want to check a type char variable against letters of the alphabet in an if function. Maybe someone could explain what I am doing wrong. #include <iostream> #include <cctype>...
  31. I

    C/C++ Dificulty getting problems started in C++

    if this is in the wrong forum i truly apologize but this is an engineering question and who better to answer but engineers, i have dificulty getting problems started in C++, i just don't know how to get a problem started, writing the rest of the program is easy but i can't diagnose it properly...
  32. L

    C/C++ Learn C++ for Loop: Finding the Total of a Series with Example Code

    I am learning how to use the for loop to find out the total of: 1/30 + 2/29 + 3/28 + ... + 29/2 + 30/1 and i wrote the following. but it doesn't work and give the correct total. can you guys tell me what's wrong? Thanks #include <iostream> using namespace std; int main () { int num...
  33. F

    C/C++ C++ trouble erasing elements from a <vector>

    Hi, I've been having trouble erasing elements from a <vector> (that is from the STL of C++) See I declared 2 vectors V and S, V contains let's say all the elements, while S is a solution set which contains some elements that are classified... well yeah... I need to create V-S which is a...
  34. Math Is Hard

    C/C++ Why use initializers for constructor functions in C++ classes?

    I'm working on learning how to create classes in C++ and I'm still a little unclear on the syntax for constructor functions and access member functions. We've been using this class called "rational" for working with rational numbers. Header and implementation files are here...
  35. Math Is Hard

    C++ assignment involving classes

    Ugh! I'm working on my last homework assignment and I can't seem to even get off the ground. :cry: The teacher created a class for rational numbers, and now we are working on some functions for a polynomial class which uses arrays of rationals from his class. My polynomials are arrays of...
  36. S

    C/C++ Efficient Computation of Large Hermitian Polynomials in C++?

    Im having difficulty computing large Hermitian polynomials in C++. I fear I may have to steer away from a recursive formula. Any help would be greatly appreciated. John
  37. Jameson

    C/C++ How I can calculate numbers in C++

    Who can tell me how I can calculate numbers to as many digits as I see fit? The normal libraries can only hold 19 or so, which is waaayyy less than I want. Any help is appreciated. Jameson
  38. Math Is Hard

    C/C++ Solving C++ Recursion Problem with Summing Digits

    Hi, I am playing around with doing stuff recursively, just to practice, and I have a problem I can't work out. I want to write a recursive function that will sum the digits of a number, take the result, sum those digits, etc. until I reach a single digit number. Then I want to return that...
  39. F

    C/C++ C++ linking/inheritance problem?

    I'm writing a Steque class that will inherit from my Stack and Queue classes. When I try to link it, I'm getting this weird error, which I'm sure has something to do with trying to inheritance. Queue.h #include <iostream> #include <cstddef> #include <stdlib.h> using namespace std...
  40. H

    Troubleshooting C++ Code: How to Fix Input Issues in a Programming Project

    I am working on a project, I am attaching my code and the Solutions...im not sure wat is wrong w/ the code, but i couldn't get it to ask for "Inputting a value for a" at all...i was able to get it to input theta1 and theta2 though. Plz help me out ASAP...I want to attach my assignment pages...
  41. Math Is Hard

    C++ assignment with .mp3 files

    OK, so I've got this wacky homework assignment that involves reading stuff out of a .mp3 file. Just to get started, I am attempting to read the first four "bytes" of the file and put them into an (unsigned char) array. I am not really sure if I am reading from the file or not - I can't tell from...
  42. Math Is Hard

    C++ converting base 10 to Roman numerals

    Hi, I just began working on a little program to convert base 10 number to Roman numerals. I couldn't figure out how to make a loop to count how many Ms, Ds, Cs etc. so I wrote it out the long way for now. I can see a lot a repetition and an obvious pattern in my divisors, since I am dividing...
  43. Math Is Hard

    C++ printing and positioning with loops

    I am working on a little piece of a program that prints two diagonal lines. I am using a variable "num" to specify how far down to draw each diagonal. What I would like to do is be able to start at a position on the screen and have the printing begin at that position, and also track the...
  44. S

    C/C++ Loading a File in C++: Tips & Techniques

    Loading a File in C Ok here is my code: FILE *fReadOpen( void ) /* purpose: open file for reading goal state: fReadOpen returns pointer to file */ { /* begin fReadOp */ /* data object declarations */ char FileName[80]; /* input file name */ FILE *pInFile; /*...
  45. R

    C/C++ Code me the php explode function into c or c++

    can someone code me the php explode function into c or c++ that would work with original strings? thanks in advance
  46. D

    C/C++ Nested Classes in C++: Protected Access Error

    Hopefully this sort of questions will soon be answered in the tutorial (good effort, Dduardo!), but for the time being, this one is not. I have the following scheme: class Foo { ... protected: struct PartOne { ... }; struct PartTwo { ... PartOne* someFunction (); };}...
  47. Dr Transport

    C/C++ Dumb question about complex arrays in c++

    In trying to learn C++ (I'm an old FORTRAN guy), I am unable to figure out how to define and initialize a complex array. Single complex numbers are straight forward, but going further has me perplexed some. Thanks in advance.
  48. SDNess

    C/C++ Do I need to learn just C++ or is C worthwhile too?

    I know Visual Basic and Java now, but I think it's time I learn C/C++. Do I need to learn just C++ or is C worthwhile too? [yes, I know they are similiar...] 1) Books/Tutorials? 2) Is there a discount [student...] for acquiring the software with? If you're familiar with both Java and...
  49. M

    C/C++ Yet another c++ question - reading multiple files

    I have the following problem: My program is supposed to read data from files to an array. The files are numbered: file1.dat, file2.dat and so on. There are 24 of those files, and I really don't want to do the same step 24 times. Is there a way to write a loop along the lines of for (int...
Back
Top