49,761 Topics

Member Avatar for
Member Avatar for monkey_king

I wan't use the multimap on my own templated class. The following is a working example with a builtin type. [CODE=c++] int dat[5] = {0,6,3,7,3}; typedef std::multimap< int, int > asso; asso dict; for (int i=0;i<5;i++){ dict.insert(make_pair(dat[i],i)); } asso::iterator pos; for(pos=dict.begin(); pos!=dict.end() ;pos++) cout << pos->first <<" next "<< pos->second …

Member Avatar for monkey_king
0
184
Member Avatar for BINDERJ2

Write a program that asks for the name of a pole vaulter and the dates and vault height (in meters) of the athlete's three best vaults. It should then report in order of the hieght (best first), the date on which each vault was made and its height. Input Validation: …

Member Avatar for Ancient Dragon
0
300
Member Avatar for onemanclapping

hi, I'm a Computer Engineering student from Portugal in the 2Âșterm. Last class' job was for us to use class and sub-class systems, creating a info system for vehicle types. I thought I was finished, but when I did the main file, the compiler shouted loads of errors that didn't …

Member Avatar for onemanclapping
0
187
Member Avatar for gangsta1903

hello,I would like to create a class for basic file operations-just reading and writing a line.There seems no error in my program but it doesn't output anything.I think there is a problem with the functions for reading and writing.Please help... [code=C++] #ifndef HANDLER_H_ #define HANDLER_H_ #include <iostream> #include <fstream> #include …

Member Avatar for gangsta1903
0
139
Member Avatar for BradenMurphy

Hey, Does anyone know any good packages that include a way to create 2d ghx along with GUI for C++. what I've got atm is wxwidgets for GUI and allegro for 2d ghx. I do not know how to combine the 2. So if someone cud tell me how to …

0
58
Member Avatar for Nemoticchigga

I am drawing on a bit my, then re-loading the bitmap(to erase it) then drawing on it again at 100Hz. I am getting flicker. Is there a way to reduce this flicker? Or a better way to do this than to reload the bitmap everytime? Thanks.

Member Avatar for TheBeast32
0
94
Member Avatar for opposition

Hey, ive written a piece of code which reads from a file called test.txt. all it does is use strtok to seperate the data from the spaces because there are alot of them, and then print them out, this worked fine when i did a test for just 1 line, …

Member Avatar for opposition
0
110
Member Avatar for osirus0830

I am having difficulty with nested loops. I am attempting to create a program that has the user enter monthly data during the course of a three year period. here is what I have so far. [code=C++] #include <iostream> const int Months = 12; const int Years = 3; int …

Member Avatar for Freaky_Chris
0
77
Member Avatar for unk45

i need help removing spaces from a string..how do i go about this?? i have to report back the number of spaces too but ive been able to do that thnx (i dont want to use any of the string functions in the string library) [code] #include <iostream> int stripspaces(char …

Member Avatar for unk45
0
271
Member Avatar for opposition

Ive been given a task where i read in a line of text from a file, and then need to seperate that line into seperate strings, ive done this however I also need to keep some attatched... the file contains "abc def ghi jkl mno", this is read in using …

Member Avatar for Narue
0
151
Member Avatar for FtKShadow

I have been working on this assignment for a while and cant get the end result to work. Can anyone help? Assignment [QUOTE]Write a function called sumTo that takes as arguments two integers. Your function should use a loop to sum all of the numbers between the two (This includes …

Member Avatar for Salem
0
190
Member Avatar for kiwihaha

Sorry for asking the topic that asked before... but im still dont know how to use that.. Below is an example create by me.. I hope that someone can tell me which part have to fix ... This is the header file: [CODE] int check_SkipCard (string input) { int SkipCard=0; …

Member Avatar for arinkverma
0
117
Member Avatar for Hacker_517

I have a problem with bulding a program to store a family record (genogram), this record consits of : name, birthday, married? and number of child. What is the best way to store this record??? Could you give me some example about some task on this structure : Input name …

Member Avatar for Nick Evan
0
101
Member Avatar for Jennifer84

I am using a List where I wonder how it is possible to find the MaxValue searching trough Value1[0] until Value1[3]. In this case it should return: 12 I have found a ::Max function but this will only consider the 2 values inside the paranthes wich then will return: 100. …

Member Avatar for Jennifer84
0
204
Member Avatar for Jennifer84

I am using this in the std:: to check for the first occurance of " " backwards (rfind). If I go managed .NET, I wonder if there is any simular method for this using str-> [code] std::string::size_type index2 = str.rfind(" ", index - 1); [/code]

Member Avatar for Jennifer84
0
149
Member Avatar for cw1184

Hey all, i'm a freshmen in college who is taking Intro to Computer Science with C++ and i'm just a beginner when it comes to programming so i have a problem. This is our assignment: [B]You are to write a program which inputs a Celsius temperature from the user, converts …

Member Avatar for cw1184
0
207
Member Avatar for meddlepal

I am having a lot of trouble with a Divide and Conquer algorithm to count the number of white cells and white cell blocks in a grid of black and white cells. Here is my grid file "cells.txt": w = white cell b = black cell [CODE] bbbbbbbbbb bwwwwwbwwb bbbbbwbwwb …

Member Avatar for ArkM
0
229
Member Avatar for gregorynoob

every time i make my own rounding routine with precision, i see my compiler suggesting a function long double round(long double x, int precision); so i was wondering if someone knows what library it comes from, i surely wasn't able to find it... thanks

Member Avatar for ArkM
0
178
Member Avatar for sgame144

I am trying to write this program that requires the following for C++: Write a c++ program to simulate the roll of a die. In principle, each of six possible outcomes is equally likely. -The program will prompt the usesr to enter the # of times the die is to …

Member Avatar for sgame144
0
87
Member Avatar for iNeedHelpPlease

Hello, Here's the details: User inputs sentence Program checks sentence for 3 magic words ("chicken", "egg", "rooster") Program keeps count of every magic word found and displays results Here's my code: [code=c++]#include<iostream> #include<string> using namespace std; const string chicken( "chicken" ); const string egg( "egg" ); const string rooster( "rooster" …

Member Avatar for dougy83
0
264
Member Avatar for mehtaneha84

I am working with fifo module...I actually found the basic code on DaniWeb, just made a few changes to it... There are 2 main sources...first one is called fifoqueue which consists of basic fifo functions i.e. qu, dequ, isEmpty and a couple more...the second one is called packetstructure which is …

Member Avatar for Sci@phy
0
171
Member Avatar for DanDaMan

All right so I'm learning C++ via library books and the information isn't too helpful, but it's the best I can find. Most of the books at my library are older than I am - copyright 1993 - some even earlier. So it's kind of ironic how the [seemingly] simplest …

Member Avatar for DanDaMan
0
141
Member Avatar for geemicah

this program is running, but the problem is., the function that I called didnt give me the accurate answer.. if you looki into my source.. what was the problem?? is the formula?? or the wrong way of calling functon?? or the whole source of my program.? this program should able …

Member Avatar for ArkM
0
144
Member Avatar for cam875

I compiled this code in dev c++ and i got 0 warnings and 0 errors, so it was a clean compile and whenever i run the exe i get this error which says assembler.exe has encountered a problem and needs to close. And gives me the error report thingy for …

Member Avatar for cam875
0
59
Member Avatar for abstract123

Hi I am working on school project to build an application to communicate between laptop and robot using bluetooth. I have basic understanding of C++. Does anyone know about any tutorial or some sort of guideline on which i can start my work on. Your help will be highly appreciated …

0
41
Member Avatar for andyT

Hi, This is my first post, this site has been very helpful in the past. I am wondering if it is possible to assign a dynamic array to a vector? If so, how? The following code is not working for me (with Visual Studio .NET 2003): [code] int *current; current …

Member Avatar for andyT
0
226
Member Avatar for FumarMata

Hello I have written my program and right now I am stuck in something that I thought that was going to be easy. I have the [B]char buffer[/B], which receives from the serial port some letters and 2 numbers at position 3, lenght 2. I want to extract those numbers …

Member Avatar for FumarMata
0
168
Member Avatar for Kplusplus

Okay, so im new to this website/forum. I am in programming 12, and as my final project in C++ I have decided to create an address book application. It will be "simple" and I was hoping to be able to get it to be able to: 1) Create new entry. …

Member Avatar for VernonDozier
0
922
Member Avatar for launic

Can someone please explain how to create a makefile? I'm somewhat confused by what I've read on the web thanks

Member Avatar for stilllearning
0
94
Member Avatar for Bigboy06

[code=cplusplus] #include <iostream> using namespace std; class Month { public: Month (char char1, char char2, char char3); // Precondition: The parameters contain the first three characters // in the name of the month - all lowercase. // Postcondition: The member variable month has been set to // the integer value …

Member Avatar for Salem
0
142

The End.