49,757 Topics
| |
Hey I have to write a program that reads a text file that contains a list of words, 1 word per line. I have to store the unique words and count the occurrences of each unique word. When the file is completely read, I have to print the words and … | |
I'm working on a program that has a class Board, and two inherited classes that will implement different games, but I'm having problems with setting up the initial Board class. The problem is that I don't know how to make it so the board array in the protected section of … | |
I am trying to open a file after getting its path from the user. here is the code. [CODE]#include <iostream> #include <fstream> #include <string> #include <cstring> using namespace std; void main(){ const char* filepath; string input, input2; char lines[110]; ifstream infile; cout << "Enter filename (including path): "; getline (cin, … | |
Hay guys, I was looking at a few examples of how a Radix sort works, and writing up a document explaining it. I based my findings on one particular example I found, link follows. [URL="http://www.cubic.org/docs/radix.htm"]http://www.cubic.org/docs/radix.htm[/URL] Well the bit shifting here is giving my head a bit of a spin, and … | |
I'm currently working on implementing a small game in C++, but when trying to compile, I get this error: [CODE]..quadtree.h:125: error: no matching function for call to 'Fleet::Ship::overlaps(const Fleet::Ship*&)' ..ship.h:40: note: candidates are: bool Ship::overlaps(const Rectangle&) const ..ship.h:85: note: bool Ship::overlaps(const Ship&) const ..ship.h:32: note: bool Ship::overlaps(const Point&) const[/CODE] So … | |
This question is for all the programmers. What makes a good prgoammers? What made you get a job? Why are you a programmer? This is not a interview, or nothing like that. This is just someone that is curious about those question. Thank you for answer or even viewing this … | |
i have a training application which incorporates c/c++ and raima database(a database system written in c) i was able to insert some data in it but i cant read from it. the files are as follows: Books.cpp : [CODE]#include "Booksh.h" #include <iostream> #include <string> using namespace std; info bookrec; Books::Books(void) … | |
Can someone help me with the follow: How would you implement mergesort without using recursion? | |
i am using a c library from c++ application and i need to fill a c struct from c++ code, this is a c++ console application. it doesnt seem to work when i assign variable values using cin. what should i do ? | |
hi. i am looking to run the following queries from the project zipped with this message: 1. List all lecturers in alphabetic order by surname within a selected department. 2. List all lecturers within a selected faculty. 3. List all modules taught by a selected lecturer. i am having trouble … | |
hello,i am new in the forum i want from any member in this forum solution this equation (in the insertion any equation for example this (sum=sum+5;) this equation not enduring ) shown in the screen or to be product: sum identifier = operator sum identifier + operator 5 number ; … | |
hi....i'm trying to write a code that generate random numbers quickly because i'll iterate my code a lot of times.....millions of times.... I use srand(time(NULL)) to initialize the seed, and random(RAND_MAX) to generate the random number, but this form is annormally slow I need help to reduce the time of … | |
The following function mixes call by reference and call by value parameters. [ICODE]void T ( int & a, int b ) { int c = a - 1; a = c + b; b = a + 2; }[/ICODE] Suppose that in main we had the following: [ICODE]int apple = … | |
Hey, I'm somewhat new to programming in c++ and I have had this code I wrote for a long time now. I wrote this about 9 months ago when I was really interested in learning the c++ language but lost interest during the summer. Well, now I'm getting back into … | |
Hi, I'v written this code for an Assignment however I was wondering if anybody had any suggestions on how to change the loops from IF/ELSE statements to Do/While, if that would be possible just the rest of the guys in my class are doing it this way with IF and … | |
error: cannot converst 'std::vector<int, std::allocator<int> >' to 'std::vector<int, std::allocator<int> >*' for argument '1' to 'void(...)' Well, he cannot convert a vector to a pointer to itself, as it is passed to the void function, where I wish to manipulate it.... I wish to operate on a vector containing about 20. … | |
If there are two arrays arr1[]={1,4,5,6} arr2[]={1,5} I want to get the output as arr[]={4,6} i.e i have to remove all the common elements that arr1 and arr2 have and printing the required output . Can any one give me the program in C++ for this with normal looping techniques? | |
Can any one slove this question? It is really hard. [url]http://img168.imagehshack.us/img168/7080/task3vn7.png[/url] I don't know how to write it in c++ but i have write up the programing logic that should work for this question. | |
Hey i need help with the final assignment of my Microsoft Visual C++ class and its a hard one its an online address book where it keeps a bunch of information such as name id birthday and etc. i know it looks messy but if you copy paste into the … | |
Hello Friends, I am trying to porting some pre-existing code to VC++ 2005 in Win XP environment. I have a segment of code like, [code] ... #include<fcntl.h> #include <sys/types.h> #include <sys/stat.h> ... ... cm_iFile = open(l_chBuff,O_RDONLY|O_BINARY); ... [/code] During compiling this file I am getting the following error message, [B]..\source\CRaterEDRFile.cpp(276) … | |
The program is all working now, but I'm worried because on the last linked lists assignment I got a C because I did not do the link correctly. My prof said that I did not create the links up correctly just used a stack to get descending in the last … | |
26. What is printed in the following code segment? [ICODE] I = 1; do { I = I + 25; } while ( I > 50 ); cout << I + 50; [/ICODE] a) 50 b) 51 c) 75 d) 76 | |
Hey, This is the same code as my other forum for those of you who were helping me there. It is all working now, but when I go to call return_value from applicant.cpp(it has to be .cpp not .h because thats how the prof made it) Its coming up with … | |
23. To convert Fahrenheit ( F ) temperatures to Centigrade ( C ) temperatures people use the formula: (32 degrees F is 0 degrees C, 212 degrees F is 100 degrees C, etc.) double C,F; [ICODE]cin >> F; C = ( 5 / 9 ) * ( F - 32 … | |
14. What will be outputted given the segment of code, if 11 is entered from the keyboard? int number; [ICODE]cin >> number; if ( number > 0 ) cout << "C++"; else cout << "Soccer"; cout << " is "; cout << "fun" << endl; [/ICODE] | |
Hi I have defined the class in C++ file as __declspec(dllexport) int clsName ::CreateDocument(char* filein, char* fileout, char* config) where clsName is the class name But after I compiled the code and use the dll in .net code I am getting a run time error "Unable to find an entry … | |
Hey, I am having problems with this code, I think it is not linking up the whole file, because when I run it it only says "hi" 3 times. And also it keeps crashing because of best[i] = point->item->return_value(); [code] #include "applicant.cpp" #include <iostream> #include <fstream> #include <iomanip> using namespace … | |
Hello everyone....again. I have a program that is using a queue. I have a class member function that is to traverse the queue, and output the smallest number in the queue. Pseudo for this function is: Compare the front and front->next. Whichever is smaller, keep it. Traverse the queue until … | |
I'm getting a strange compile error with getline. My question is if you make a statement like: [CODE] getline(is, a.lastName, ','); [/CODE] can you revert back to: [CODE] getline(is, a.country); [/CODE] Or in other words, once you set a delimiter, are you bound by that delimiter for the rest of … | |
First, let me introduce myself. I was a pretty good C programmer, back when [and very modest as well.] I got into other lines of work and have been out of programming for several years. The other lines of work have ... you have read the headlines, right? I need … |
The End.