49,761 Topics
| |
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. | |
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 … | |
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 … | |
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 … | |
Say I have a class named Contestant, could I declare an instance of the Contestant class as: [CODE] Contestant *c = new Contestant; [/CODE] | |
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 … | |
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)// … | |
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 … | |
[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) … | |
I am having trouble reading the second matrix from my file. Can anyone help me please? Thank you! | |
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 … | |
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: … | |
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 … | |
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. | |
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 … | |
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[]= … | |
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. | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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. … | |
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 … | |
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 … | |
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? | |
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() … | |
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 … | |
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. … | |
|
The End.