49,755 Topics

Member Avatar for
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
94
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
187
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
563
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
119
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
187
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
75
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
63
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
227
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
71
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
218
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
159
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
314
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
826
Member Avatar for shahab.burki

Hi, I make a try again on Link List in Visual C++ but got an error. The code is looking right but when I debugged the source, then I realize that when the LINKLIST constructor is called then the two Node type pointers *start and *last creates trouble. Please do …

Member Avatar for computercobra
0
216
Member Avatar for emiller7

This is not a complete program, I have comments to omit the incomplete portions. After "Player One" enters a row (see lines 54-5), the program ends. It outputs the "Enter a column" and the board and ends. I don't see why. Any help would be greatly appreciated! (Output after runtime …

Member Avatar for emiller7
0
80
Member Avatar for JAGgededgeOB172

Hi all, I'm just asking for help for my linked list sort function, I'm not including my entire program, as I'm sure my problem lies in my sort. I need to sort the linked list by rearranging the pointers, I was fairly sure I got the function correct. When I …

Member Avatar for JAGgededgeOB172
0
102
Member Avatar for r0flc0pter

Hello there, I'm creating kind of a GUI system, and I found myself in trouble when inheriting my base class in my other classes. This is the gui header: [code] #ifndef _GUI_H #define _GUI_H #define WIN32_MEAN_AND_LEAN #include <windows.h> #include <vector> #include <string> #define GUI_VERSION 1.0.0.1 #define TRUE 1 #define FALSE …

Member Avatar for ArkM
0
151
Member Avatar for Acis

Ok, im making a Text Based RPG and well just look at my problem. [CODE=C++]#include "Library.h" using namespace std; //Constant Integers //Functions void StartGame(); void LoadGame(); void Berkshire(); void Game_Menu(); //Integers int Gold = 0; int Health = 20; int Energy = 20; int Mana = 10; int numItems = …

Member Avatar for nucleon
0
72
Member Avatar for blahblah619

[I]Modify the program so that it reads input temperatures from a text file (named temps.txt) instead of the keyboard. The file should allow one temperature per line. The program should end when the end of the file is reached. Modify the screen output statement so that it includes the input …

Member Avatar for vmanes
0
103
Member Avatar for Ellisande

As part of a project I'm working on, I need to develop a program that can take in a sentence and convert it somehow (I'm choosing to convert into Pig Latin). At first I thought this was going to be a piece of cake, until I realized that after [code]#include …

Member Avatar for Ellisande
0
116

The End.