49,761 Topics
| |
Basically this is suppose to read zipcodes from a file and sorts them in ascending order then calculates the total amount processed. I am getting output, but I think my problem is somewhere in my sort function. The program pretty much runs down to the last zipcode in the file … | |
those are the maps: [CODE] multimap<SortKey,T> firstMap; multimap<SearchKey,pair<SortKey,T>*> secondMap; template <class T,class SortKey, class SearchKey> bool GarageDataBase<T,SortKey,SearchKey>::Add(T data,SortKey key1, SearchKey key2) { multimap<SortKey,T>::iterator it; it=(firstMap.insert(pair<SortKey,T>(key1,data))); pair<SortKey,T> *mizi=&*it; secondMap.insert(pair<SearchKey,pair<SortKey,T>*>(key2,mizi)); return true; } [/CODE] I am trying to insert a pair into the firstMap and get a pointer to this pair and … | |
Here is the problem I am supposed to be answering: Suppose an expression is represented in a string (i.e., 35*4+5/(4+5)). Write a function that splits the expression into numbers, operators, and parentheses. The function takes an expression as the argument and returns a vector of strings. Each string represents a … | |
Hello all, I am working on a couple of programs and having similar problems with both, not sure what am doing wrong and would appreciate help as usual. The first program should have a class which can store up to 10integers. Only one copy of any integer(no duplicate value. Program … | |
Hi all, If anyone uses OpenSSL, I'd appreciate it if they can take a look at this code, where I'm trying to encrypt and decrypt a short test string. At first I used to get a run time error in the RSA_public_encrypt(...); and I thought that it was caused by … | |
Hello, Please tell me how can i generate an array in mfc, how can push element and how can initialize array? I want to make dynamic array of hexadecimal values. Thanks. | |
[I]<<split from [URL="http://www.daniweb.com/forums/post1219054.html#post1219054"]here[/URL]>>[/I] I know this is an old post.Didn't feel like exploring this sick site just to post a new one. But seriously Daniweb sucks. Its full of ppl who think they are the greatest programmers alive and everyone else are donkos. And they dont even know anything. All … | |
Hello and hi. I've just used Hyperterminal to connect to a Bluetooth device. So far it works and I can send data to it using Hyperterminal. Now, is there any way that I can replicate the same serial communication in a C++ program? I'm using VS 2008. Are there any … | |
Well, I've been doing a bit of coding here and there. I mostly mastered the simple functions, such as loops and if checks and I have a fair understanding of classes and references. I also know about pointers and several other things regarding c++. I also know how to work … | |
I have following line of code. [CODE]test[k]->Auto->printPowerStatus();[/CODE] This prints out following 0 ON, 1 ON, 2 ON, 3 ON, 4 ON, 5 OFF, 6 ON, 7 ON 8 ON, 9 ON, 10 OFF, 11 ON, 12 ON, 13 ON, 14 ON, 15 ON I want to be able to search … | |
Hi everyone I need to be able to read each character from a text file and store them in an array here is the text file: ********************* Ace of Spades 10 of Spades 3 of Clubs King of Spades 5 of Spades ********************* Queen of Diamonds King of Hearts Queen … | |
Hi i have a problem in programming I need to search a line from a text file by just entering an identifier. Text File: "my Record.text" contents: 101,Carl Cool,500.00 102,Kurt Cobain,400.00 103,Kid Marion,300.00 the console should ask the id number.. ex. ID:101 and give the output: ID:101 Name:Carl Cool Rate:500.00 … | |
Im supposed to create a program that will read 10 floating pt numbers into an array of 10 double. The program is supposed to quit on non numeric input, which i have succeeded in doing, and also the program is supposed to take an average of all of the numbers … | |
hello every body , i have just a little question , someone can tel me what the [B]difference[/B] between [B]array<Byte>^[/B] and [B]array<Byte>[/B] thank you , dr dre say's " what's the difference betwwen me and you " ;) | |
I'm attempting to create a function getPredecessor() in which the function recieves an int in reference to a position in the list and should return a pointer to the node [U]before[/U] that position. If the position is the first place in the list, return 0. Here's my header (followed by … | |
An unsigned integer is of 2 bits. What i wnat to do is to shift an int a right one time and at the same time obtain the A(15) bit in some variable how can i do that? i know this will perform a right shift on int a and … | |
Ok so we were given a homework assignment and I am having trouble with it. We are supposed to minipulate a box in the center of the screen with the input given by a user. The input values given are height and width. How can I create a box in … | |
I have a program that reads in a file and extracts the front of a tag and the end and puts them on their own line, but for some reason it's missing some tags. If this is my file: <tag>something</tag><tag>something2</tag><tag>something3</tag><tag>something4</tag><tag>something5</tag> It would output should look like this: <tag>something</tag> <tag>something2</tag> <tag>something3</tag> … | |
hi, i've been working on this problem for way too long and i can't find the answer. here's my code: [code=c] #include <cstdlib> #include <iostream> using namespace std; int main(int argc, char *argv[]) { int N; int M; int i; cout << "Input a positive integer: "; cin >> N; … | |
can u define languages?? by using turbo c?? can you give an example problem by using turbo c like if statement,while,do-while,nested if,modular,and sequential........ | |
please help me in making a voting system. dont know how to tally the votes in c++. | |
I saw an example of friend class on [url]www.cplusplus.com[/url], please find it below: [CODE] // friend class #include <iostream> using namespace std; class CSquare; class CRectangle { int width, height; public: int area () {return (width * height);} void convert (CSquare a); }; class CSquare { private: int side; public: … | |
Beforehand I know how to define a macro in a file like header file by using #define directive but I want to know, regarding Visual C++ compiler, is there any kind of file which is specifically used to hold a macro so that we can use it anywhere in our … | |
Yes, I have read the sticky MANY times, however it does not help me with my problem. The issue is that I have a program where [icode]getch()[/icode] is used in conjunction with [icode]kbhit()[/icode] in order to only recieve input when the user hits a key. The problem is that if … | |
Hello, I am writing the code for a cash register, and I have searched the site and nothing comes back that helps me, it basically has to take the change and break it up to the fewest 100's, 50's, 20's, 10's, 5's, and 1's. I have already written the cout … | |
error message is seen on the goto statement. did I miss library ? this is a part of script. #include <cstdlib> #include <iostream> #include <conio.h> using namespace std; int main() { int a = 0, b = 0, c = 0; cin >> a >> b >> c; //assume error … | |
Hello, i need help to convert any 1, 2, or 3 digit number into words using string/array method in C++. For example, 111 should read one hundred and eleven, 011 should read eleven, 001 should read one. I would much appreciate it if you could help me solve this problem. … | |
When I compile I get this error message for istream error: no match for 'operator>>' in 'in >> ((Rock*)this)->Rock::myName' I did not include the program with main because I have not used it yet. [CODE] #ifndef ROCK_H #define ROCK_H #include<iostream> using namespace std; enum RockName {BASALT, DOLOMITE, GRANITE, GYPSUM, LIMESTONE, … | |
hey everyone i have sugested to create a new club in my school called programmers , so they told me that i have to bring a list of the club aims and they xheck if the aims are good or bad then they accept the club or no , so … | |
Hello! I have been working on a game for quite a while now, it's 3d, and it's an FPS (First Person Shooter). I want to have it where you shoot the AK-47 Rifle, it makes a gun noise. I want it to be a semi auto gun, so it can … |
The End.