C++ Definition and 813 Threads

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

    C/C++ Use of 'const' in C++ functions

    The use of 'const' in functions seems to be an endless source of confusion. Am I right in thinking that in this case: double functionName(class const & parameter) {...} the const specifies that the reference to the class being fed into the function may not be modified? And that in this...
  2. E

    Comp Sci C++ Program Help: Calculate Average Weight & Height by Age & Gender

    //****************************************************************** //Sherman Brown //CIS 150-01 Programming in C/C++ //April 17, 2011 //Program #7 //Organizing data by age and gender, calculating average weight/height. //*******************************************************************...
  3. A

    C/C++ HELP How to process multiple files in C++

    HELP! How to process multiple files in C++ I have been bashing my head against my desk in my cubical trying to figure this out. I have approximately 500 files I would like to read in, one at a time, into a C++ program, do my processing, and send the results to a new file. I can do the...
  4. E

    C/C++ How Can I Optimize a Function with Nested Variables in C++?

    Hi, I have to compute the optimal value of function of several variables. The function is maximized and/or minimized by nested variables x,y... For instance min(x) max(y) f(x,y). The function is known and the variables take a values from a known finite domain. I have thought a solution where I...
  5. I like Serena

    C/C++ Why are the C++ programming standards so inconsistent?

    It's a pity that the various coding standards that I have seen are inconsistent as to when to use #include "file_spec" or #include <file_spec>. The "High Integrity C++ Coding Standard" says: High Integrity CPP Rule 14.9: Use <> brackets for system and standard library headers. Use ""...
  6. S

    Comp Sci Why Is My C++ Loop Not Calculating Standard Deviation Correctly?

    Homework Statement I need to write a program (which passes by reference) to find the standard deviation of an array of numbers. Homework Equations http://en.wikipedia.org/wiki/Standard_deviation < the simple standard deviation formula is the one I am using. I've tested the program...
  7. PainterGuy

    C/C++ C++ header files with and without h extension

    c++ header files with and without "h" extension hi fine people,:wink: i have seen some people use header files with ".h" extension and some without it. what is reason? i think there are some header files where you are required to use ".h" such as "#include <windows.h>. you can not use...
  8. PainterGuy

    C/C++ Difference Between C++ and C++ Standard

    hello everyone,:wink: i was reading somewhere that there is C++ and C++ Standard. could some please tell me the main difference between two? and i also read something that some things such as "getch()" are non standard. can you guide me a bit on this? i will really appreciate this help of...
  9. S

    C/C++ Why are my mesh points changing in my 1D linear convection C++ program?

    I'm learning c++ and currently trying to write a little programme for 1D linear convection (wave equation). I have managed set all boundary and initial conditions as well as a mesh. But I have reached the point where I can't understand why the program does what it does. In red I...
  10. PainterGuy

    C/C++ What make Mac OS more safe if C++ is

    hello nice people, it was read by me that both ms windows and apple os has been made using basicaly c++. some days in past on a some antivirus article it came to my attention apple os is safe from virus than windows. if both use same kind of bricks they why bricks are easy to break in...
  11. PainterGuy

    C/C++ C++ Programming Basics: A Walkthrough Tutorial

    hello guys, i have downloaded dev-c++ as suggested by some nice guys around here. from today i will start practcing with comuter programming. me know nothing about programing but sure will learn it with the help of this forum. okay. i have opened new project named "gorilla" in dev-c++. it...
  12. PainterGuy

    C/C++ What Questions Can We Ask to Challenge Our Arrogant C++ Teacher?

    hello everyone, this question is not directly connected with programming so forgive me for asking here. me and my friend have decided to take some c++ classes in a instituion. me have been there once. the guy who teaches (or tries hard at teaching or behaving like teacher) is very rude and...
  13. S

    C/C++ What Types Can Be Arguments in C++ Class Methods?

    I have seen the following in a abook: "The argument(s) of a method can be any type of object (as long as its class has been made available to the program), as well as the predefined default types of variable. For example, methods in our three-vector class are not limited to just accepting...
  14. D

    C/C++ Where can I find a comprehensive C++ crib/reference sheet for beginners?

    Hi: does anyone have a link for a C++ crib/reference sheet which includes everything. I'm having hard time with formatting the logic for some of my homework questions and I would like to have a quick reference sheet which explains the functions. I'm using the compiler CodeBlock 10.5 with...
  15. G

    C/C++ Solving Gauss-Legendre Algorithm in C++

    Hello , i have the algorithm attached and i am trying to execute it in c++. My code until now is : ( i have created the function f with limits (-1,1) ) #include <iostream> #include <cstdio> #include <cstdlib> #include <iomanip> #include <cmath> using namespace std; const double...
  16. PainterGuy

    C/C++ Object-Oriented Programming in C++ (4th Edition) by Robert Lafore

    hello every1, i was able to find this book "Object-Oriented Programming in C++ (4th Edition) by Robert Lafore" in a local library. I am thinking of self-learning c++.. do u have any information on this text...is it easy...im totally blank in this area of programming and computers in...
  17. PainterGuy

    C/C++ Turbo C++: Is it Any Good for Learning C++?

    hello, someone has recommedned to me to use compiler turbo c++... is it any good? what is your take? programming thingy is totally new thing to me...i want to learn c++ though i have no prvious backgrond in this area. your help is much aprreciated. thanx
  18. G

    C/C++ C++ simpson's method -loop doesn't stop

    c++ simpson's method --loop doesn't stop Hello, i have done the simpson's method and it works fine.My problem is that it doesn't stop when it gives me the desired result but the loop continues for ever.. #include <iostream> #include <cstdio> #include <cstdlib> #include <iomanip> #include...
  19. F

    C/C++ Efficiently Solving Sudoku in C++

    Hey everyone, I'm trying to teach myself C++ and I recalled that a few years ago my Comp Sci major buddy of mine did a sudoku solving program as a project for a class so I decided to tackle it on my own. I'm getting some headway, but I'm having trouble figuring out a way to "brute force"...
  20. PainterGuy

    C/C++ C++ compiler to write not-very-complex DOS/text-based programmes

    hello, would you kindly recommend me some simple C++ compiler programme to write not-very-complex DOS/text-based programmes? I'm new to C++, is one supposed to write pseudo-code into the compiler or instructions in terms some high level language? kindly let me know. thanks.
  21. A

    What programming languages are used in computational astrophysics?

    Hi, just wanted to know which version of FORTRAN is best to learn for one studying astrophysics...and whether C++ is of any importance in computational astrophysics...Thanks
  22. J

    C/C++ C++ conditional testing fails, why?

    I have a long C++ program that has a few simple statements in it. At the beginning I have ; #define NUM_DP 10 Further on in the program I have this conditional statement; short int ct, j; . . . ct = op2.test(op2.num); if (ct < (NUM_DP - 1)) for (j = 1; j < 20...
  23. B

    C/C++ C++ How to gracefully exit multiprocessing

    Not a homework problem. I've written a little compute-intensive code. That only keeps one core busy. So I run four copies. But compute time is variable so I thought I'd try my hand at multiprocessing. I can fork to create four processes. No problem. I/O is from cin, cout and the...
  24. G

    Comp Sci Help with C++ perfect number program

    Ok I've been having a lot of trouble with this program, I am also very new to C++. The program requires to have 4 functions 1 main, 1 svr, 2 void functions any kind of loop (for loop preferred) in the main function so that a user can enter any number of positive integers in the main function...
  25. Demon117

    C/C++ Trying to write a program that converts integers to roman numerals in C++

    Here is the code that I have come up with. What could be implimented to make it compile and run? It runs, but all that comes up is the request for the integer between 1 and 3999, after I enter the number the program simply ends. CODE: #include <iostream> using namespace std; string...
  26. D

    C/C++ What is so special about running a c++ program through commnd line?

    I.e., what is beneficial about main(int argc,char *argv[])? I see a lot of seemingly good programmers write the main like this, but what does it do that int main() cannot do?
  27. X

    C/C++ Need help incorperating SOCKS5 Proxies into C++ program

    Hi there. I've been trying to incorporate Proxies into a program I am currently making. It's basically a c++ Chat bot that will load proxies from a list and connect from them into a chat, but I'm having a bit of trouble. I've found a SOCKS 5 Wrapper, but I'm having trouble with that as...
  28. C

    C/C++ How Can I Best Learn C++ Before Starting a Cognitive Neuroscience PhD Program?

    Hello all, I'll hopefully be attending a cognitive neuroscience PhD program next fall and I'd like to learn some programming beforehand (having programming skills helps for lots of neuroimaging labs) Labs I've worked in used UNIX and MATLAB and I'd really like to improve my knowledge before I...
  29. A

    Comp Sci Difference between some if statements C++

    Say for example int a = 0; if ( a ){ ... } int a = 0; if ( a < 0 ){ ... } What's different with the first if statement? or do they have the same meaning? Thanks EDIT: What is the use of two-dimensional arrays? I see it mostly in file input output stream stuff. And...
  30. G

    C/C++ Solve Bisection Problem in C++: Find the Root

    Hello, I wrote a code for my problem but i can't find the mistake.It doesn't give me the right answer. We must find the root using bisection method. I found with mathematica that the solution is x= -3.18306. The function values are x (-4,-3). Any help is welcome! #include...
  31. L

    Comp Sci C++ how to obtain the x value of graph corresponding to a certain y value

    Homework Statement i have drawn a graph in C++/root which is a bunch of points (in an array) joined together ie it is not a function. it looks kind of like a gauss, but isn't ie its a peak. i want to find out the x distance between the points of 90% and 20% of the maximum. i am having...
  32. C

    C/C++ Solving Prime Number Code Error in C++

    I was writing a program to find if a given number is prime or not. I can't figure out what the error is. /* To check if a number is prime*/ #include <iostream> #include <cmath> using namespace std; int main() { float a; int p,i,f=0; p=sqrt(a); if(a %...
  33. J

    C/C++ Troubleshooting Segmentation Faults in C++ Operator Overloading

    I'm trying to write a program in C++ that reads, writes, adds and substracts numbers entered as C-style strings. I have two questions. Is it necessary that the parameters of the + operator only be always objects of a class? Can an operator call another operator from within it, e.g. my_float...
  34. L

    Comp Sci Drawing a graph using C++ / ROOT (CERN)

    Homework Statement Im having difficulty drawing a specific graph. I am not entirely sure how to explain my question/ the graph i need to draw so i think the best way is to provide a bit of my code and explain using it the graph using it... the code below gives a read out of the energy...
  35. L

    C/C++ Why isn't my code producing a graph with a log scale in C++?

    can someone tell me what is wrong with my code. i get the graph that i want but not with the log scale... i have tried multiple methods. this is the last one i tried (its part of a canvas which is split into quadrants) TH1F* h3 = (TH1F*) inputfile3 -> Get("pdg"); c->cd(3)...
  36. D

    C/C++ Problem with iterator for vector of lists in c++

    For a function using namespace std; mst(const vector<list<pair<int,int> > > &adj_lists, int v){ // code before iterator list<pair<int,int> >:: iterator it; it = adj_list[0].begin(); // code after } I'm trying to set up an iterator to walk through the list contained within...
  37. A

    Comp Sci What is the use of % in calculations? How can it be used to solve a calculation?

    What is the result of.. int*double=? Is it double? int+double=? is it double too? And... What is "%" in a calculation? And how to solve the a calculation using "%"?
  38. A

    Comp Sci Why Is My C++ Program Not Running as Expected?

    Hi. I need help with in running my program, when I tried it in the computer lab, my program didn't run..And I'm sure it couldn't run because of my workings..which I assume are incorrect. I appreciate it if you could tell me where did I go wrong with my calculations and if it matched the...
  39. J

    Comp Sci C++ determinant of diagonal matrix

    Homework Statement well, my assignment was to make a gauss elimination, so now i need to compute the determinant of an n by n diagonal matrix variable rows = number of equations variable i = random integer matrix A[100][100] dummy matrix A2[100][100] Homework Equations det[A]...
  40. U

    Comp Sci C++ question- turning scores to letter grades, and more

    Homework Statement We have multiple sections of a class for which we need to produce grading summaries by section. The grading summaries that we need are a count of how many students earned A’s, B’s, C's, etc., and the lowest, highest and average grade for each section. At the end of...
  41. C

    C/C++ C++ Passing Variables Between Classes

    Hi, I am new to programming, but I think this is a simple error. For my programming code I am trying to pass a variable from a certain class to another class. The code is similar to below.Class 1 #include "class2" Class2 class var1=1 var2=2 class.acceptingvariablesfrom1(var1 var2)...
  42. M

    Comp Sci Can't write calculated resulted to file in C++

    Homework Statement Dear physics forum, I'm start learning C++ and I'm trying to program a space transform function for linearized convection-diffusion problem using Code:block Everything was fine until I wrote calculated result into a file. When I run the program, some error message...
  43. S

    Comp Sci Solving Unknown Error in C++ Code

    after typing these following code when running this code error occurs,but the editor doesn't indicate me where's the problem
  44. N

    C/C++ Should I Learn C or C++ for Scientific Applications?

    Hi there, I am a third (maybe second year for US standard?) year mathematical physics student and I have just realize that I do need obtain some programming knowledge. My university has a compulsory courses that teaches java programming, but, looking around I've come to the conclusion that...
  45. I

    Comp Sci First time programming ever and my first project has 1-21 errors in c++

    Homework Statement #include <iostream> using namespace std; int main() { int firstNo;// first number is stored here int secondNo, int resultAdd,// variable for result when first number and second number are added int resultSub,// variable for result when first number and second...
  46. I

    Comp Sci Help evaluating boolean number and arithmetic operators C++

    Homework Statement !( ((count<10) || (x<y)) && (count >=0) ) where count is equal to 0Homework Equations i don't think any equations here are necessary except maybe the precedence lawThe Attempt at a Solution they combined 'and' and 'or' which confused the heck out of me. How do i figure out...
  47. T

    C/C++ Building Neural Networks with C++

    Hello again, Im trying to build a neural network using C++. Has anyone had a go? I think the potential implications are really interesting and would like to hear about how people might have implemented them. Another general one for anyone.
  48. P

    C/C++ What is the issue with multiplication in my C++ program?

    Hi, I am having an issue with multiplication in C++. I am writing a program to check the validity of an NHS number. To do this I must; multiply digit 1 of the NHS number by 10, multiply digit 2 of the NHS number by 9, multiply digit 3 of the NHS number by 8 ...etc The answer from each...
  49. D

    Comp Sci Maximum Digits and Bits for C++ unsigned long double

    in C++, how many digits and how many bits is the maximum allocated for unsigned long double?
  50. M

    Comp Sci Is My C++ CellStatus Function Causing Print Failures After First Generation?

    it prints fine for the first generation, but nothing else after that. i am thinking that my problem lies in the cellStatus function and its implementation within the printCell function. attached are the files that i am getting input from and the file that i am printing to. #include...
Back
Top