49,761 Topics

Member Avatar for
Member Avatar for winbatch

Why doesn't this compile? I am trying to use multimap and am unsuccessful. [code] #include <iostream> #include <map> #include <algorithm> using namespace std; int main() { multimap<string,long> test; string a="BLAH"; long b=8; pair<string,long> c( a, b ); test.insert( c ); return 0; } CC Test.cpp -o Test "Test.cpp", line 11: …

Member Avatar for winbatch
0
364
Member Avatar for Acidburn

Hey guys its me again! I'm stuck on a logic thing of where to put some code. Basically I want to take an input from the keyboard and store that into an array using a class whilst combining it with the other stuff that the class does. [code] void hangman::getletter(char …

Member Avatar for Drowzee
0
97
Member Avatar for Puckdropper

Hello, I've been trying to write a program for a class I'm taking, and have gotten stuck on part of the assignment. The program is to: >9> Create a template for a safe array. The user will be able to designate the element type and the size of the array. …

Member Avatar for prog-bman
0
145
Member Avatar for JoBe

Hello ladies and gents, I'm reading about the algorithm partial_sum and there are two different versions of this. The first one just calculates cumulative numbers like this: [code] #include <iostream> #include <numeric> #include <vector> using namespace std; int main() { int a[4] = {10, 20, 30, 40}, b[4]; partial_sum(a, a+4, …

Member Avatar for Stoned_coder
0
99
Member Avatar for Tomas Lopez

I'm writing this program for a class and when I tried to compile it I get an error can anyone help me out I can't see to find the problem. Here is The program with the error: [color=blue]1: #include <iostream> 2: using namespace std; 3: 4: 5: 6: int main() …

Member Avatar for Tomas Lopez
0
86
Member Avatar for paradox814

so basically this is what I am doing: myClass a,b,c; a = myClass( ... ); b = myClass( ... ); c = a+b; this is simple enough, but now I have to overload the operator... [code]myClass myClass::operator+ (myClass f) { myClass temp; temp.value1 = value1*f.value1; temp.value2 = value2*f.value2; temp.value3 = …

Member Avatar for Rashakil Fol
0
90
Member Avatar for Coach_Nate

Trying to get this to compile is driving me nuts! Any help is greatly appreciated. I think it's having trouble linking the header to the .cpp files. It's my first program in Dev C++ - I'm used to using Visual Studio. Here's the source for the header header: [code] #include …

Member Avatar for Ancient Dragon
0
106
Member Avatar for Shaun Hannah

I am new to these internet news groups; but I am excited to learn because you people seam to know your stuff!!! I am fresh out of college; where I studied computer science and did very well. I stumbled upon a small business that does pest control. They hired me …

0
58
Member Avatar for sam1

hi first i apologise if this is not the place to post this thread. :) Is it possible to create a couronne game like the one in minilip : [url]http://www.miniclip.com/couronnedeluxe/index.htm[/url] using c++ or any other programming language as java etc. thanx

Member Avatar for bops
0
95
Member Avatar for kavsak

I have a legacy dll which is used to convert data from a datalogger to Access, and was developed with Visual C++ under NT. However, it will not work under Win2k or XP - it runs but all the data is set to 0. I have traced the problem to …

0
37
Member Avatar for katman1

Recently I upgraded from a 16-bit (SB Live) to a 24 bit (Audigy LS) soundblaster card. My c++ program played 16 bit wave images in memory without a problem. I'm trying to modify the code to play 24-bit wave images in memory, but I get nothing out of the sound …

0
53
Member Avatar for Ancient Dragon

Is there a c++ std:: function that will trim trailing spaces from std::string? I know how to do it myself, but I was wondering if anyone knows of something in <altorithms> or elsewhere? Thanks

Member Avatar for Ancient Dragon
0
115
Member Avatar for Acidburn

Hello, I got my array sorted with different words in it [code] #include <iostream> #include <ctime> using namespace std; int main() { cout << "this program will chose a name from a list randomly" << endl; char holdingArray[5][5] = { "John", "Andy", "Matt", "Jane" }; char chosenBuffer[6]; // holds randon …

Member Avatar for Dave Sinkula
0
99
Member Avatar for Acidburn

Hello I figured out my other problem, now left with another 2. One which I beleive is a logic error since if I enter A it will output AA but I cant seem to solve that one. Also the other is that I'm using app (append). How can I delete …

Member Avatar for Dave Sinkula
0
83
Member Avatar for ramcfloyn

Im attempting to do bitwise operations on a character string and want to use the bitset template. I am having some trouble, it doesnt seem to like to be constructed using a char* string or std::string... I'm knew to this particular template. Here is what I'm attempting: std::bitset<3000> Line("abcdefghijklmnop..."); anyone …

Member Avatar for ramcfloyn
0
160
Member Avatar for haruhiko

:) Hi, I'm a newbie here. I just want to know how to change this code so it can count word instead of letter code: [code]#include <iostream> #include <fstream> using namespace std; // count letters 'a' to 'z' in string s void countLetters( string s ) { int pos, sum …

Member Avatar for Drowzee
0
103
Member Avatar for djbsabkcb

What is a two way templatized linked list in C++? Does it mean using syntax below for classes and member functions definitons? [code] template<typename type_variable> [/code]

Member Avatar for djbsabkcb
0
129
Member Avatar for m7r23

I have no idea how to use these two. I tried for 2 hours. And I also read the c++ books, but no luck. Can some body start me out.

Member Avatar for m7r23
0
139
Member Avatar for BenPage

Hi there. I am desperately needing a library that can provide me with basic matrix arithmetic. I am using a MFC VC++7.1 project for which I want the matrix functionality. I Need: >> To multiply matrices >> Calculate determinant of a matrix. >> Calculate inverse of a matrix. >> Calculate …

Member Avatar for Ancient Dragon
0
93
Member Avatar for sifuedition

I need to use a class for a program that reads an input file, prints the file, sorts the list then prints the sorted list. This is for a Programming II class. I can see how to print and sort. My issue is the input file and the array. I …

Member Avatar for sifuedition
0
160
Member Avatar for ultimate_fusion

i am into making games and most games have cut scenes. as i am not passed the 2d stage and dont have a clue about 3d animation i was thinkin it would be easier to get a mate to make a flash movie for my game. so can you play/open …

0
83
Member Avatar for vps

hello everybody I am writing a jni wrapper for c++ api's the c++ dll is on linux, so i get a .so shared library. I am working on windows, using vc++ 6.0. can i include the .so shared library in my workspace in vc++. when i do it i get …

Member Avatar for vps
0
101
Member Avatar for SpS

Hi, Please see the code below. [code]void Allocate( char* s ) { s = (char*)malloc( 100 ); } int main( ) { char* s = NULL; Allocate( s ); strcpy( s,"Test");/*I know that this will fail. b'coz I still have a NULL pointer in s. Initially s was pointing to …

Member Avatar for winbatch
0
99
Member Avatar for SpS

I am back again with a new query...preparing for technical interview questions --------------------------------- Without using sizeof operator,can we find sizeof datatype.

Member Avatar for Stoned_coder
0
440
Member Avatar for djbsabkcb

I am trying to write a program that reads in a file of numbers, writes to a file and displays the numbers in correct order. I don't fully understand how to read the file and pass that information into my class declarations in order to output before and after the …

Member Avatar for Stoned_coder
0
122
Member Avatar for j1979c

[B][FONT=Arial]err....... is there any command line in Dos to make it full screen, so that i can put it into a system(" ") line in my c++ console program? Thanks in advance.[/FONT][/B]

Member Avatar for Electrohead
0
297
Member Avatar for Kind hearted

Hello all, I am ammature rpohrammer althought i started w2ith C from 1996 but got trouble with world. still like C++ and c. I have question right now which programming language is best for low leval programming . i am doing right now c++ have some experinace in c and …

Member Avatar for SpS
0
124
Member Avatar for Phantom Driver

Hi, I'm a college student at UAH that hasn't taken a computer science class in almost 2 years. I need this one to continue on with my major, but I can see that I remember a lot less than I'm suppose to. Basically, I don't understand what he's asking for …

Member Avatar for Rashakil Fol
0
130
Member Avatar for sifuedition

Well, here is the gist of the problem. When I read in a file of integers, if there is a formatting character at the end, the last integer is repeated. For instance, in the code, it is reading i01.dat. If that file reads as follows: 2 3 4 5 with …

Member Avatar for vegaseat
0
172
Member Avatar for winbatch

It seems that with vectors you can only delete via iterators. Since I can access and update by index [], shouldn't I be able to delete by index? The reason I ask is that when you delete via the iterators and the value exists multiple times, I believe it deletes …

Member Avatar for Rashakil Fol
0
5K

The End.