49,761 Topics

Member Avatar for
Member Avatar for launic

Anyone know how to pass an entire hashmap to a function?? The hashmap is hash_map<string, wordStruct> hashofwords; wordStruct contains information about each word in the hashmap.

Member Avatar for launic
0
151
Member Avatar for Stefano Mtangoo

Hello All, I now learn Python and would slowly want to learn C++. I got little brushing on C++ very long ago and was very introduction and I know C++ is harder than Python. Can somebody point some good tutorials, IDEs and free books around the Net? Very newbie worried …

Member Avatar for William Hemsworth
0
119
Member Avatar for sandipank

Hello all, I am using Turbo C++ 5, which doesnot allow me to use "namespace std" etc. Can anyone tell how can I be able to do that? I think this namespace concept is new and Turbo C++ compiler is older one. Can anyone suggest new C++ compiler where I …

Member Avatar for Nick Evan
0
95
Member Avatar for cplusplusgeek

I am developing an application for a video store, can someone guide me on different fragments of it.I need some help here. Here is what i have come up so far: [code=cplusplus] #include <iostream.h>// #include <string.h> #include <fstream.h>//Library fro File I/O using std::string; class Video { private: //Data Members string …

Member Avatar for Ancient Dragon
0
130
Member Avatar for nizbit

Say I have a class named Contestant, could I declare an instance of the Contestant class as: [CODE] Contestant *c = new Contestant; [/CODE]

Member Avatar for grumpier
0
99
Member Avatar for opposition

Hey, Im just wondering if there is a fuction that already exists which finds a character in a string and then ignores everything after it. Its reading in a whole line from a text file and then suppose to seperate it. [QUOTE] char myString[500]; indata.getline(myString, 500, '\n'); [/QUOTE] the text …

Member Avatar for iamthwee
0
122
Member Avatar for Bigboy06

i need help with this code it compiles and runs fine but it is not giving me the results i expect the problem is i think on the switch statemen. Here is where the problem is and then there is the rest of the code [CODE=cplusplus] void Month:: Output(ostream& outs)// …

Member Avatar for ArkM
0
334
Member Avatar for launic

Can someone please give me an example of how to use .find() with a hashmap? This is what I have: (wordData is a struct with info about each word, and hashFunc is the name of the hash function) typedef hash_map<string,wordData,hashFunc> wordHash; wordHash hashofwords; (after passing in a string s to …

Member Avatar for sidatra79
0
195
Member Avatar for slayman89

[code] int main() { vector<double> list; bool more = true; while (more) { double x; int yes; cout << "Do you have numbers? yes=1 or no=2" "\n"; cin >> yes; if(yes == 1) { cout << "Enter number""\n"; cin >> x; list.push_back(x); yes = 0; } if (yes == 2) …

Member Avatar for slayman89
0
237
Member Avatar for vrga

I am having trouble reading the second matrix from my file. Can anyone help me please? Thank you!

Member Avatar for vrga
0
112
Member Avatar for gangsta1903

I want to create a class for I/O operations. This class take filename as parameter and then provides functions to write and read from file. I had to include two different fstream objects,one for input and one for output ,so I designed such an implementation.If you can see a better …

Member Avatar for gangsta1903
0
134
Member Avatar for amrith92

I've made a program that generates a Character's details(Game details, like level, name, HP, etc, based on a few parameters). I've added another .cpp file to it [without a main() function], but when I try to compile the whole project in Dev-Cpp, it just shows an error. My code is: …

Member Avatar for TheBeast32
0
160
Member Avatar for ART01

I have got stuck with a very basic prb in Linked lists, i m familiar with array, as in array to compare two elements of the array u can simply use their position in the array since they are all positioned in a consecutive manner in memory like: if(arr[2]<arr[3]) //do …

Member Avatar for sidatra79
0
105
Member Avatar for scholar

Hi friends, The problem is to find out the factorial of a large number say 20 and display it purely in terms of numbers not like 2.333e23.

Member Avatar for ohnomis
0
101
Member Avatar for ohnomis

Hi, I've just started a course in C++ about 3 weeks ago. Unfortunately, I'm pretty lost at the moment with this problem and my teacher said I'm on my own now. (I'm guessing he doesn't want to answer my questions anymore because I ask too many, but I really don't …

Member Avatar for ohnomis
0
527
Member Avatar for mzdiva041986

How do I add deletion to my program?????? [CODE]#include <iostream> #include <set> using namespace std; int main () { set<int> myset; set<int>::iterator it; pair<set<int>::iterator,bool> ret; // set some initial values: for (int i=1; i<=5; i++) myset.insert(i*5); ret = myset.insert(15); if (ret.second==false) it=ret.first; myset.insert (it,8); myset.insert (it,9); myset.insert (it,11); int myints[]= …

Member Avatar for twomers
0
106
Member Avatar for justinlake888

If the question says... "user can enter input up to five times" - does that mean you use a "for loop" since you know the # of times? or do you just use a "while loop" please help. thanks.

Member Avatar for Sci@phy
0
96
Member Avatar for scholar

Hello friends, there is yet another problem for you... We have got a string say HOUR Now we need a program that can choose the specified number of words say n from this word in all possible ways and displays them ...for example in this case for n=3 the output …

Member Avatar for Sci@phy
0
109
Member Avatar for Jennifer84

I am using StreamReader to read a File. With the code below I am able to read a whole line. What I wonder is how it is possible to read a comma delimited file like these lines. How will I put the delimiter ',' and also assign the values to …

Member Avatar for Jennifer84
0
255
Member Avatar for ShadowOfBlood

I'm working on this as an assignment for Computer Science 121. I thought I had the code working, but I couldn't figure out one crucial part. The assignment is to convert phrases (such as 'GET LOAN' or 'CALL HOME') into telephone numbers (438-5626 and 225-5466 respectively). The program has to …

Member Avatar for ShadowOfBlood
0
1K
Member Avatar for gotnoname

Heya, could use some help from any nice fellah around. This is a highscore that sorts by score[index] and then name[index] follows. There's some more features I would like to add to it like a menu e t c, but for now I want the basic thing working asap. Help …

Member Avatar for gotnoname
0
206
Member Avatar for cam875

im writing my own assembler and the only thing that is going wrong is reading the input from the source file I dont no how to read one word at a time so if i have a statement like mov 25 3 it can read mov store it than 25 …

Member Avatar for cam875
0
196
Member Avatar for bone7_7

Im trying to learn c++ in school but the book does not break it down FOR ME ENOUGH, could some body suggest a book like c++ for dummies or something that would really help me out. Im engineer major in my sophmore year and I have plenty more programming ahead. …

Member Avatar for RaiTsu
0
110
Member Avatar for RayvenHawk

I'm working on an assignment and I need to swap the values from the left side of the tree to the right side and vise versa. I'm having no luck on it so far. Here is the header file with the important areas [code] template<class elemType> struct nodeType { elemType …

Member Avatar for Sci@phy
0
244
Member Avatar for saneeha

I want to use the function GetFileSecurity() to retreive the security descripter of a file in the Master File Table from NTFS.. The function definition is [code] BOOL WINAPI GetFileSecurity( __in LPCTSTR lpFileName, __in SECURITY_INFORMATION RequestedInformation, __out_opt PSECURITY_DESCRIPTOR pSecurityDescriptor, __in DWORD nLength, __out LPDWORD lpnLengthNeeded ); [/code] The fifth attibute …

Member Avatar for Ancient Dragon
0
173
Member Avatar for ashishchoure

I got the latest Direct X SDK and Microsoft Visual Studio and I want to learn how to code games in C++. I self learn most of my coding, but I want to know a straight out beginners book for C++ and Direct X Gaming. Can you guys suggest anything?

Member Avatar for Ancient Dragon
0
66
Member Avatar for Royalwolf

hello friends i start learning c++ and still at basics and was trying to solve a exercise in second chapter. this exercise asked to print a square using asterisks. i am able to create a asterisks solid square and colde is as follows. [CODE]# include<iostream> using namespace std; int main() …

Member Avatar for Royalwolf
0
3K
Member Avatar for yazooney

Very basic questions but hard to find in google! [CODE]return sqrt(eps - 2.*log(eps + rand()/(double) RAND_MAX))*cos(rand()*pi2/RAND_MAX);[/CODE] The part of the formula where it says "2.*log". I belive the "dot" only represnts that the number 2 is 2.0. However, I am not 100% sure about this as I actually dont see …

Member Avatar for Ancient Dragon
0
87
Member Avatar for asifjavaid

Hi guys, Hope you are fine by all means. I am developing a video plugin in VC++.NET by using directshow filters. My software is getting input of wmv file and it will be uncompressed generating two files video and audio. Now i want to get input for MPEG-2 video format. …

0
90
Member Avatar for volscolts16

The End.