49,761 Topics

Member Avatar for
Member Avatar for Moe

Hello! I am writing a program to overload ~ operator to reverse the given string. Here is my program. The problem message is that"Could not find a match for string::string(char). I am writing my program on linux. I can not use strrev function. [code] #include<iostream.h> #include<string.h> class String { char …

Member Avatar for Lerner
0
313
Member Avatar for hurbano

I have an assingment in which i have to right an algorithim to get through a maze. I dont know where to really start with it. I know in the instructions it said to write it as though we used our right hand as a guide. in other words we …

Member Avatar for hurbano
0
109
Member Avatar for emiller7

The following program accepts five student names and 4 test scores for each. Then calculates and displays the average and letter grade for each students. Well, that is what it is supposed to do. Judging by the long list of errors I get, it looks like none of my arguments …

Member Avatar for VernonDozier
0
6K
Member Avatar for blackbyron

Hello, I am writing a program about gas pump. Here is my code [ICODE]class GasPump{ public: GasPump();// loads all pumps w/ 50 gallons, price is 2.00, 2.25, 2.50 GasPump(int l, int m = 100, int h = 100); //price is 2.00, 2.25, 2.50 GasPump(double pl, double pm, double ph); // …

Member Avatar for blackbyron
0
105
Member Avatar for erin0201

Here is my code including header files. My program is supposed to be a fraction calculator that handles exceptions such as division by zero, division by non-integer values, allows user to re-enter any values the program threw an exception for, and allows the user to continue to use the program …

Member Avatar for erin0201
0
133
Member Avatar for perumar

The type Point is a fairly simple data type that represents a point in the two-dimensional plane. Write a definition of a class named Point that might be used to store and manipulate the location of a point in the plane. You will need to declare and implement the following …

Member Avatar for tux4life
0
260
Member Avatar for Thew

Hello, is there any way how to listen to communication on COM ports? Not to open them for using, deny any application from access to it, just to watch the data comming in and out the COM port.

0
37
Member Avatar for johnray31

Friends, I was wondering if i could have a map of list . I was trying like this ..but i think i can't do like this. Any suggestion to do things like that or any alternative solution with help of c++. [CODE] #include <iostream> #include <list> #include <map> using namespace …

Member Avatar for nucleon
0
95
Member Avatar for daviddoria

I'm just trying to figure out how this stuff works. I wrote this function: [code] #include <algorithm> #include <vector> double VectorMax(const vector<double> &a) { vector<double>::iterator pos; pos = max_element (a.begin(), a.end()); return *pos; } [/code] and call it with: [code] vector<double> Numbers; Numbers.push_back(3.4); Numbers.push_back(4.5); Numbers.push_back(1.2); cout << VectorMax(Numbers) << endl; …

Member Avatar for nucleon
0
189
Member Avatar for daviddoria

I am trying to use the for_each from stl algorithm. [url]http://www.cplusplus.com/reference/algorithm/for_each.html[/url] [code] #include <algorithm> #include <vector> #include <iostream> template <typename T> void OutputObject(const T &obj) { cout << obj << endl; } template <typename T> void OutputVector(const vector<T> &V) { for_each (V.begin(), V.end(), OutputObject); cout << endl; } [/code] I …

Member Avatar for daviddoria
0
569
Member Avatar for usman2k4u

Implement the following improvement to the quick sort and find out the percentage of key comparisons that can be saved in each case. Using randomly generated 1000 integers as input for sorting. Repeat the experiment 1000 times for each case to get the average percentage reduction in key comparisons. Case …

Member Avatar for Narue
0
5K
Member Avatar for jimjohnson123

Ok I am having an issue with a program. I am in C++ II but my issue is I have not taken C++ I in over a year so I am at a disadvantage...we are working on a program and this is the information we were given and this is …

Member Avatar for VernonDozier
0
127
Member Avatar for tomtetlaw

can anyone suggest any tutorials for the vc++ resource editor? or can anyone tell me how to use it? i know how to design the forms but i dont know how to use it in my code any help would be appreciated :)

Member Avatar for tomtetlaw
0
193
Member Avatar for csurage

Greetings, I am trying to create a gui, you guys helped me to find a great gui tutorial. Now I want to run another program in the background of the gui which will constantly monitor the time of the system. I tried using shellexecute in the file where I wrote …

Member Avatar for tomtetlaw
0
141
Member Avatar for johnray31

Friends, when i try to compile this program i am geting this error!! ListMemoryFree.cpp: In member function 'void example::add(LinkSlcMap*)': ListMemoryFree.cpp:41: error: 'm_link' was not declared in this scope but to me it seems fine.:) plz point out my mistake!! [CODE] #include <iostream> #include <list> using namespace std; struct LinkSlcMap { …

Member Avatar for johnray31
0
76
Member Avatar for jakethesnake86

Below I have a small portion of the code I have been writing for QT GUI. It is important for my design that I am able to use signals and slots within my GamePanel class, but for some reason it will not work there! When I click on the button …

0
64
Member Avatar for pamod

Hi guys, I'm suppose to make a database for a library system. can any of you help me out on how to assign an auto generated number for each record entered.I'm a bit new to the language. Thanxxxx.

Member Avatar for Ancient Dragon
0
77
Member Avatar for Zcool31

I have a parent class and two child classes that inherit from the parent class. The parent class has a protected pointer to something, and a method to access that pointer. [code=cpp] class parent{ public: int* accessPtr(){ return ptr; } protected: int* ptr; }; class child1 : public parent{ public: …

Member Avatar for Zcool31
0
228
Member Avatar for neodregan

Hello everyone! I have a Huffman algorithm that is going along really smoothly and I've gotten to the part where I have store the paths to nodes in an array from a tree. This is what I have so far: [code] /*************************************************************** * huffTraverse * **************************************************************** * huffTraverse() reads in …

Member Avatar for monkey_king
0
218
Member Avatar for preet4fun

enum Days { Sunday, Monday, Tuesday, Wednesday,Thursday, Friday, Saturday }; for( Days d = Sunday; d < Saturday; ++d ) cout << "d is: " << d << endl; C++ won't know how to increment d unless we define how that operator works for the type Days. Overload operator ++ …

Member Avatar for Ancient Dragon
0
72
Member Avatar for daviddoria

I found this while googling for something [url]http://msdn.microsoft.com/en-us/library/ms177203(VS.80).aspx[/url] I tried it (with g++) and it seems to be a syntax error - is this like something specific to Visual Studio or something? Dave

Member Avatar for Narue
0
87
Member Avatar for ARYT

Hi everybody Thanks again for your helps in my last thread. Now, I have some more problems. :( 50 Errors for this program. Certainly, a basic problem within the structure of class "Block". This assignment is all about "Class and objects". We can use functions, but no arrays. [code=cplusplus] #include …

Member Avatar for monkey_king
0
219
Member Avatar for Takafoo

Can someone help me with what I've done wrong with the character count function? it should be returning abcdefghijklmnopqrstuvwxyz ABVDEFGHIJKLMNOPQRSTUVWXYZ as 52 but it is coming back as 136088??? [code] #include <iostream> #include <cctype> using namespace std; const int STRINGSIZE = 100; void getString(char string[]); void reverseCase(char string[]); int numGraph(char …

Member Avatar for Narue
0
143
Member Avatar for Mossiah

Hi, I have done this program that calculates the average and letter grade of 10 grades, but i would like the program to ask the user how many grades he want to enter. plz help, I have tried many ways like -- [CODE] int size = 0; Cout <<"How many …

Member Avatar for Narue
0
162
Member Avatar for player183

Hello there , i've got a problem , i made this program for a Football league stats sheet, but the program needs to grab the highest and the lowest value of each teams in age / weight (poids) / height(taille) i'm having a really hard time and i'd like someone …

Member Avatar for player183
0
108
Member Avatar for naveuye

Hi all, i m new to the programming storie, can any one please help me? i want to write a program that allows the user to input the diamention (e.g heit, weight) used to draw the object shape. the program should then compute the area and display the shape based …

Member Avatar for sittas87
0
150
Member Avatar for asifjavaid

Hi, I have a file of approximately 4.19GB. I want to get the totall size of file using code in VC++, Here is my code [code] FILE *fptrSampleVideo = fopen(filename,"rb+"); if(fptrSampleVideo) { fseek(fptrSampleVideo,0,SEEK_END); uncompressedVideoSize = ftell(fptrSampleVideo); } [/code] If the file is of small size, ftell() return position correctly and …

Member Avatar for Ancient Dragon
0
319
Member Avatar for homeryansta

Why won't this let me choose my own array size? Queue line[qs_pair] is what i'm concern about. As you can see, I have the user input from the terminal the size of the array. But when I compile it, it gives me an error on visual studio. line unknown size …

Member Avatar for Freaky_Chris
0
102
Member Avatar for lehe

Hi, I am using copy_n from GNU C++ Library under Ubuntu 8.10. My code is like this: [code] #include <ext/algorithm> using namespace std; void myfun(char * flags ) { char * flags_new = new char[3]; copy_n(flags, 3, flags_new);// both copy_n and copy would give not in this scope error. delete …

Member Avatar for John A
0
232
Member Avatar for cruisx

Hi guys, have a school project that i am working on but i am just running into this one problem. Well its not really a problem its more of a me just starting the c++ course and i just wanted to do something extra to get some more marks. We …

Member Avatar for computercobra
0
827

The End.