49,761 Topics

Member Avatar for
Member Avatar for v31
Member Avatar for VernonDozier
0
45
Member Avatar for orangejuice2005

Am working on this assignment that involves having to make our own Hashmap ADT and am working on it but i can't see to get further because i don't know what this error its giving me is: [inlinecode] unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl operator<<(class std::basic_ostream<char,struct std::char_traits<char> …

Member Avatar for orangejuice2005
0
68
Member Avatar for Agni

Hi.. whats the best way to initialize a char* ? i tried using char* p = ""; and it gives segmentation fault at times. not sure how to initialize it. this is the function where i'm using it. screenReturnValue variable is not getting initialised properly everytime, when i call this …

Member Avatar for Agni
0
15K
Member Avatar for Yaka

hi guys, heres the problem. i have an assignment to change certain letters or combination of letters into some other letters or just to make them dissapier. Say like.. "the" to>> "ze", where "th" is replaced with "z". the program is consists of functions like these. checking two letters forward …

Member Avatar for Yaka
0
140
Member Avatar for LindseyV

Hi there and thank you in advance for your help in advance. I am having problems with my page replacement program with taking the integers from an input file and putting them into an array. I need it in format [Next page in] | | | | (current pages between …

Member Avatar for Lerner
0
324
Member Avatar for programmer01

Hi. i am taking a C++ intro course and one of my projects is to create a program that will give me the beta 0 and beta 1 of a regression. The user must input a the following: how many data sets?, each of the Xs and each of the …

Member Avatar for Lerner
0
209
Member Avatar for chocl8drop

I'm trying to implement operator overloading. I think I was successful with overloading the input and output function. Do I need to keep the current functions and add functions such as [code] bool operator == (const HugeInteger&, const HugeInteger&); [/code] My program is listed below. Please point me in the …

Member Avatar for Lerner
0
380
Member Avatar for rem0404

So what I'm supposed to do is take a text file and read it into a set of string vectors. The file has three types of data in it, in this order: title, artist, genre. I need to read it into the vectors so that each data type is only …

Member Avatar for Lerner
0
125
Member Avatar for GPXtC02

How can i read in data in different functions without losing the stream's place in the file. i.e function a and function b both open a data stream to read in first and last names from a file. however function b reads in the first name as well rather than …

Member Avatar for Ancient Dragon
0
107
Member Avatar for NeroMaj

Here is the background: I am working on a project in which I have a base class called Account. In this base class I have the functions updateValue(int num_of_years) and void toString(); Next I have three subclasses of this base class, which are MutualFund, Bond, Buried. Each of these is …

Member Avatar for NeroMaj
0
103
Member Avatar for allialli

hi. i have a program that i am having some troubles with. if anyone could give me any suggestions, it would be greatly appreciated! : ) i have to edit the main some more to get this to actually work. and i also have to add info into the function. …

Member Avatar for Ancient Dragon
0
124
Member Avatar for henpecked1

In my cdrom class I have a member function called returncost, and a private data member cost. [code] float cdrom::returncost() { return(cost) } [/code] Later, in a free function I call that member function to calculate a total cost and average cost. [code] void showcosts (cdrom &cd1, cdrom &cd2, cdrom …

Member Avatar for henpecked1
0
495
Member Avatar for infernojmd

Im trying to put a while loop in here and when i do i get tons of errors. but when i run it with out the while loop it works. this program inputs the first and last name and puts it as last, first. and uses strings for that and …

Member Avatar for Ancient Dragon
0
107
Member Avatar for blcase

[code=cplusplus] bool fun1() {if (root) return doFun1(root); else return false;} bool doFun1(Node *ptr){ if(ptr->left) doFun1(ptr->left); if(ptr->right) doFun1(ptr->right); if(ptr->left) doFun1(ptr->left); ptr->data=ptr->data*7; if (ptr->data>500) cout<<.5*ptr->data<<endl; else if (ptr->data<50) cout<<5*ptr->data<<endl; return true;} int main( ) { Tree t; t.insert(14);t.insert(13);t.insert(31);t.insert(27);t.insert(12); t.fun1(); return 0;} [/code] I am trying to trace through this and the output …

Member Avatar for hacker9801
0
117
Member Avatar for henpecked1

If I have a class called cdrom, and one of the member functions is loadinfo, what is the difference in these calls? cd1.loadinfo cd1->loadinfo I ask because my compiler is choking on the first and actually asking me if I meant to do the second.

Member Avatar for mitrmkar
0
94
Member Avatar for BabyEyes

Hi , this is the first time i ask for help here i have been searching for a good place to ask and i found daniweb i hope i be right of what i am thinking . and to get help from you guys. thank you here is the question …

Member Avatar for BabyEyes
0
126
Member Avatar for hezfast2

I'm working on a program that reads a file of scores and then outputs the number of scores in certain ranges. I've got it to read the input file (scores.txt) which is set up as follows; 76 89 150 135 200 76 12 100 150 28 178 189 167 200 …

Member Avatar for hezfast2
0
151
Member Avatar for bvrclvr1

Hi All, I am a student and this is a project I am working on. The main idea is that this program will calculate the number of months it will take to pay off a loan. There are catches in place to only allow positive entries and to check to …

Member Avatar for bvrclvr1
0
106
Member Avatar for Project_Panda

I'm using the directive pragma once in two header files. Both headers use vector, iterator, iostream, and string (and using namespace std). Some things may seem redundant and inefficient but it's the way our instructor wants us to write it. Anyways, in my file register.cpp, I want to include both …

Member Avatar for Narue
0
177
Member Avatar for Project_Panda

Specifically, specific elements. A project requires us to delete elements in a vector via course number. I assumed one would use an iterator, so that being said, would this work? [CODE]void student::drop_course(int d) { vector<int>::iterator f = find(c_id.begin(), c_id.end(), d); vector.erase(f); cout << "You have deleted course number " << …

Member Avatar for Project_Panda
0
136
Member Avatar for flower77

I am working on one-dimensional arrays for class assignment. I don't think I have this right. Can someone check this: The question is: Write the c++ code that will count the number of elements in an array (named number) of base type int. that are equal to a key value …

Member Avatar for Ancient Dragon
0
121
Member Avatar for anifreak

hello there! i'm new n i need real help! i got this homework and i have to have it done before tomorrow! i tried so hard n i cried all the last night *cries again* i hate queues!!!!! anyway plz help me if u can. i have to write 3 …

Member Avatar for William Hemsworth
0
123
Member Avatar for littlestone

What will happen if caught exception when new a object? For example: [code=c++] ClassTest* ptr = 0; try { ptr = new ClassTest; } catch(...) { } [/code] if the constructor of ClassTest throw exception, what will happen? will ptr == 0 ? some memory leak?

Member Avatar for Narue
0
165
Member Avatar for DigitalPackrat

I am creating a game, without using any game related libraries, only the "standard" (read aside) ones and an [URL="http://www14.brinkster.com/aditsu/dev-cpp-faq.html#conio"]edited conio.h[/URL]. So I get to use getch(), kbhit() et al. My problem is with kbhit(), is there no way of resetting it, so that I can reuse it? Aside : …

Member Avatar for DigitalPackrat
0
129
Member Avatar for DigitalPackrat

[code]class Customer { private: char name[50]; int acc_no; char acc_type; float balance; public: void getData(); }; int main() { Customer cust; cust.getData(); cust.getData(); } void Customer::getData() { cout<<"Name : "; cin>>name; cout<<"Acc No. : "; cin>>acc_no; cout<<"Acc Type : "; cin>>acc_type; } [/code] The second time I call the function …

Member Avatar for DigitalPackrat
0
137
Member Avatar for shotjase

Hey guys i have a header file and now i am writing the implementation file and defining the constructors..i am having trouble with 1 but.. void bitmap:save (string filename) { } //The bitmap representation is written to filename. The bitmap file will consist of two positive integers R and C …

Member Avatar for Ancient Dragon
0
88
Member Avatar for stevo356

Hi guys, I'm both new here, and new to c++ so be gentle! Over the past short time we've been looking at c++ on our course, but I don't believe it has been taught too well, and I'm struggling to understand what should really be basic concepts? An assignment we've …

Member Avatar for Ancient Dragon
0
120
Member Avatar for freakinsweet865

[code] double classAve (double g, int i); char gradeLet (double z); int main () { int ans, count = 0; double grade, numTot = 0; cout<<"Do you have a grade to enter? (Yes = 1, No = 2) "; cin>>ans; cout<<endl; while (ans != 1 && ans != 2) { …

Member Avatar for Ancient Dragon
0
96
Member Avatar for n3XusSLO

how do i use a function without calling it from a different class? (i have more files in my project) i made a test function called dostuff() { } inside some random file outside a class. but when i want to compile i get this: Error 1 error LNK2005: "void …

Member Avatar for n3XusSLO
0
241
Member Avatar for Black Magic

EDIT: I've got a while loop in my code, just now when player 1 goes to have his/her second attack the hp is reset to 99, [code=c++]#include <conio.h> #include <iostream> using namespace std; int main() { int p1attack, p2attack, p1hp, p2hp; char attack; p1hp = 99; p2hp = 99; system("TITLE …

Member Avatar for Sky Diploma
0
160

The End.