49,757 Topics

Member Avatar for
Member Avatar for trantran

I am reading the (otherwise excellent) The C++ Programming Language (4th edition - Hardcover) (Stroustrup) and I cannot understand about 4 pages of it despite a lot of attention to it. It's section 27.4.1 Composing Data Structures starting page 767. After reviewing obviously unsatisfactory alternatives on page 767 for a …

Member Avatar for trantran
0
801
Member Avatar for catastrophe2

hi so i have to make a copy of a linked list i made last week and this time i just have to update it with a deep copy concept thus making a copy of that list i made. here is my code: #include <iostream> #include <string> using namespace std; …

Member Avatar for catastrophe2
0
298
Member Avatar for DS9596

So I have this but I'm not really sure of how to print the smallest element of array `a` , print the sum of all the elements in array `a` , and print the average of all the elements in array `a`. Help please. Is this how to print out …

Member Avatar for nullptr
0
204
Member Avatar for deceptikon

##Why Use Arrays?## Let's begin by considering why arrays might be needed. What is the problem that this feature solves? How does it make your life as a programmer easier? When studying new features, it's important to recognize what that feature does for you and where the incentive is in …

Member Avatar for mike_2000_17
4
747
Member Avatar for vegaseat

This AVI file player has some nice features like adjusting size and speed. The program uses the standard MSvfw32.lib (called libmsvfw32.a in the DevCPP lib directory). Another example of using BCX to translate to C code and modify to something Dev-C++ can handle. Enjoy!!!

Member Avatar for triumphost
0
4K
Member Avatar for lewashby

When I try to compile the program at the bottom this is what I get. `-> qtprogram.cpp:1:24: fatal error: QApplication: No such file or directory` I got this code from a C++ QT book and I'm compiling this on Linux with this command. `-> g++ -g -Wall "${ARG}" -o "${ARG:: …

Member Avatar for JasonHippy
0
145
Member Avatar for PulsarScript

//The code contains 10 distinct syntax errors. //Rewrite the code, correcting all syntax errors. int _tmain(int argc, _TCHAR* argv[]) { int numStamps{4} = {0,0,0,0}; ProcessFileData(numStamps); DisplayDenominationTable(numStamps); double totalCost = CalculateCost(numStamps); cout << "Total cost of stamps is " << totalCost << " euro"<< endline; return 0; } //this is my …

Member Avatar for Suzie999
0
237
Member Avatar for Kristian_2

Hi guys, I have small problem with my example code. Any hint? #include <iostream> using namespace std; class A{ public: int a; A(int i){a = i;} A(const A& rhs) // copy constructor { a = 2; } A(const A&& rhs) // move constructor { a = 3; } }; void …

Member Avatar for mike_2000_17
0
424
Member Avatar for vishalonne

Hello Does every function in C++ returns value? If yes what is that value and what is the use?

Member Avatar for Learner010
0
229
Member Avatar for Rootz

I have been racking my brain for a bit on this and just can't figure it out. The book "Object-Oriented Programming C++" by Joyce Farrell pg382 exercise 13. They're wanting me to make a class named "PlayingCard" that contains 4 fields which are values and suits in both numbered and …

Member Avatar for Rootz
0
483
Member Avatar for agrbinoo.albaker

Write a complete C++ program that reads the attached file (values.txt) to find and print the following: a. The average value of the numbers in the file. b. The maximum and minimum value c. The count of negative and positive values (ignore zero) #include <iostream> #include <cstdlib> using namespace std; …

Member Avatar for agrbinoo.albaker
0
298
Member Avatar for Hector_2

The code isn't displaying and then reversing entered numbers. reverse.cpp // // #include <cstdlib> #include <iostream> #include "linkedStack.h" using namespace std; int main() { linkedStackType<int> stack1; linkedStackType<int> stack2; cout << ""; cout << "output your name\n\n"; int number = 0; // AUSE LINKED STACKS // cout << "Enter first number …

Member Avatar for Hector_2
0
332
Member Avatar for moaz.amin.37

i want to understand that what is bolean data type in c++. I tried to my best but i can not understand boolean data type plz help me

Member Avatar for Schol-R-LEA
0
381
Member Avatar for Mohamed_34

Write a program that can do the following: addition of two matrices . subtraction of two matrices. multiplication of a matrix by a scalar. multiplication of a matrix by a matrix.

Member Avatar for deceptikon
0
142
Member Avatar for Praveen_10

I am trying to write a code that checks if password is pass with the use of functions...but i am not able to ....Please help me i am a beginner....and i need this program to be written strictly using functions....thsnk u in advance

Member Avatar for Praveen_10
0
187
Member Avatar for ravi_14

i am developing a project in c++ and i need database to save details.i googled but so far have bot come across a good tutorial for c++ database . most of the articles i have found are obsolete. please suggest what are APIs for database in c++?

Member Avatar for Ancient Dragon
0
469
Member Avatar for agrbinoo.albaker

Write a program that uses a for statement to sum a sequence of integers. Assume that the first integer read specifies the number of values remaining to be entered. Your program should read only one value per input statement. A typical input sequence might be 5 100 200 300 400 …

Member Avatar for agrbinoo.albaker
1
966
Member Avatar for smitsky

I'm having a problem accessing information between classes. The following simple program illustrates the problem. I have two classes. Int Cell and second. IntCell has a single data member: storedValue. I initialize the value of storedValue to 0, and then assign a value of 16 to it in main() on …

Member Avatar for Ancient Dragon
0
202
Member Avatar for TheFearful

This is the code that I have for inserting a node, but I don't know how to do the delete function. Any tips would be helpful // Constructor Tree::Tree() { root = NULL; } // Destructor Tree::~Tree() { freeNode(root); } // Free the node void Tree::freeNode(Node* leaf) { if ( …

Member Avatar for TheFearful
0
163
Member Avatar for m.a.u.

Greetings everybody, I would like to ask you which C++ libraries you use for ethernet communication? In web I found several; [boost.asio](http://www.boost.org/doc/libs/1_55_0/doc/html/boost_asio.html) [Nut/OS](http://www.ethernut.de/api/index.html) [Sockets](http://www.alhem.net/Sockets/index.html) Is there another and easy? By the way, which one of these three libraries are easier to use :) . Thanks in advance

Member Avatar for m.a.u.
0
167
Member Avatar for newbiewwcode

Can you guys please help me understand when to use const? For example, if I have the following functions: viod add (int* array) { int total = array[1] + array[2]; } viod subtract (int* array); viod times (int* array); viod divide (int* array); viod printArray(int* array); and I only intend …

Member Avatar for newbiewwcode
1
203
Member Avatar for beastie805

I got a small program here, I am just trying to return a string value from a function through a reference parameter but I keep getting an error. Any help or tips will be appreciated #include<iostream> using namespace std; int timesTen(int, string&); int main() { int number = 6, product; …

Member Avatar for beastie805
0
447
Member Avatar for m.a.u.

Greetings everybody, I have been develolping a program for isochronous USB communication. In run time, when allocating memory for transfer, libusb_transfer, ENOMEM error arises. I have been looking for a solution for this problem, but I have not come to a conclusion, yet. What might be the reason of this …

Member Avatar for m.a.u.
0
463
Member Avatar for Brandon_6

You cannot determine whether a ctor is being called on an object that is to become const. Such as: const Foo bar( another_foo ); // no way to determine in the ctor that bar will be const I'd like some sort of function attribute for copy constructors to determine if …

0
157
Member Avatar for smitsky

Hi. Why am I getting different output when I call the calculate() function? The output on line 184 gives 1.0001, while the output from line 433 gives 1. Thanks. #include <iostream> #include <string> #include <limits> #include <vector> #include <iomanip> using namespace std; /** * Global Variables */ string k; int …

Member Avatar for smitsky
0
198
Member Avatar for admiri92
Member Avatar for Moschops
0
250
Member Avatar for Aditya_8

gimme the error plz it says undefined symbol _main in module c0.asm #include<iostream.h> class largest { private : int num1,num2,num3,big; public : void enter(int a,int b,int c); void max(void); void display(void); }; void largest::enter(int a,int b,int c) { cout<<"Enter numbers n"; a=num1; b=num2; c=num3; cin>>a>>b>>c; } void largest::max(void) { big=num1; …

Member Avatar for Ancient Dragon
0
163
Member Avatar for mR-_-EBoOo

how I can introduce printf and scanf in microsoft visual c++ 2010 express i used #include<stdio.h> , #include<isotream> and using namespace std; put it still doesnt work ???

Member Avatar for rubberman
0
126
Member Avatar for catastrophe2

hi so this project requires an input of U, M, or D and as many as you like of them (i think, might be only up to 100 based on charUMD[100] array in code) also, you have to end it with # in order to indicate the end. i am …

Member Avatar for catastrophe2
0
327
Member Avatar for mR-_-EBoOo

You are required to write a C++ program to covert a positive inter code into English name equivalent for the digit. A valid code is of size between four (4) to six (6) digits inclusive. A zero is not allowed in a code. Example: If input is 234056 the output …

Member Avatar for deceptikon
0
268

The End.