49,761 Topics
| |
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 … | |
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 … | |
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 … | |
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); // … | |
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 … | |
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 … | |
| 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. |
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 … | |
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; … | |
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 … | |
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 … | |
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 … | |
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 :) | |
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 … | |
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 { … | |
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 … | |
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. | |
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: … | |
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 … | |
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 ++ … | |
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 | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … |
The End.