49,761 Topics

Member Avatar for
Member Avatar for some one

hi plzzz i need ahelp to know what rong with this program the problem is in the display function the code [code]#include <iostream.h> #include<string.h> class Employee { private: char number[55], name [55], salary[55]; public: Employee(); ~Employee(); void set(); void display (); }; Employee::Employee() { cout<<"The constructor called"<<endl; } Employee::~Employee() { …

Member Avatar for some one
0
283
Member Avatar for simon126

[code]#include <iostream.h> void askforprices(); double rate (double old_price, double new_price); int main() { askforprices(); return 0; } void askforprices() { double old_price, new_price, rate; cout << "Please enter old price\n"; cin >> old_price; cout<<"Please enter new price\n"; cin >> new_price; rate = rate(old_price, new_price); //points to this location for an …

Member Avatar for simon126
0
646
Member Avatar for aminura

In the following code I am giving an int value to class using type casting-- [CODE]#include<iostream> using namespace std; class A { int a; float b; public: A() { a=0; b=0; } A(int m) { a=m; cout<<"\n values are"<<a<<endl<<b; } }; void main() { A a1; a1=1; }[/CODE] The members …

Member Avatar for SpS
0
213
Member Avatar for Savage221

Hello, I'm working on a program and I'm close to finishing it, but theres one (or two) parts that I'm unsure of depending on how I set it up. The program has to have a user defined function flip(). Flip is only supposted to randomly generate a 0 or 1, …

Member Avatar for firepiro05e91
0
1K
Member Avatar for daybreak7

I am trying to edit a field as it is being input, not waiting for the <CR> using Microsoft VC Borland will allow a "myChar = cin.get();" and will return the char immediately to program control. Microsoft insists that it must be followed by a <CR> before the program can …

Member Avatar for daybreak7
0
132
Member Avatar for jpheezy

I am having trouble getting my program to store values and to be changed throughout the functions. Any help would be much appreciated. Here is the code. [code]#include <iostream> using namespace std; void DisplayMenu(void); void Enter_Inventory(); int Display_Inventory(int inventory_number_coke, int inventory_number_pepsi, int inventory_number_cd, int inventory_number_hires); void Purchase_Soda(); int main() { …

Member Avatar for Ancient Dragon
0
71
Member Avatar for Acidburn

We've been told to design our own class for strings. I've sat down and managed everything so far but I've stumbled accorss something. We've been asked to implement a concat algo. [code] strings* strings::concat(strings *s) { char str[10]; for(int i=0; i<5;i++) { str[i]=m_psz[i]; } for (int j = 0 ; …

Member Avatar for Dave Sinkula
0
177
Member Avatar for lalfonsob

Hi everyone, I spent 2 hours trying to make this code work but I couldn't do it. Can someone point out what I'm missing or what I'm doing wrong? Thanks in advance. [CODE] #include<iostream> using namespace std; bool isFactor(int a,int b); int main() { int num1, num2; cout<<"Enter a number: …

Member Avatar for Dave Sinkula
0
103
Member Avatar for becca

I am using the Dev-C++ compiler. Right now I am having a problem using GLUI. I have installed GLUT and tested some examples, which worked. I have installed the devpack (I believe that is what it was called) for GLUI and am unable to do any examples. The includes are …

Member Avatar for urubu715
0
431
Member Avatar for Gamermonk10

As a first year c++ coder, i was intreaged by the language as soon as i sat down in the classroom. However, on a school assighnment,I have come upon an error that is unfamiliar to me. The assighnment was to simplifly a program that was far too complex. The end …

Member Avatar for Gamermonk10
0
224
Member Avatar for SpS

Hi guys....i want to access MSAccess using C++....don't know how to.......suggest me some ways to do that

Member Avatar for Ancient Dragon
0
117
Member Avatar for blackdove

I have been given a lab assignment that should take a prefix expression such as *+-23/427 and use recursion to solve its infix equivilant ((2-3)+(4/2))*7. So far, the code I have will work for an equation with 2 or 3 numbers. Any more and it starts returning weird results. Its …

0
74
Member Avatar for kyakobi84

What is the code for ( e^x = 1 + x/1! + x^2/2! + x^3/3! + ..... ) anyway can help me, plzzz :cry: :rolleyes:

Member Avatar for alloy_zeus
0
264
Member Avatar for winbatch

[code] #include <vector> #include <iostream> using namespace std; class Test { public: Test() { cout<<"In TEST constructor"<<endl; } ~Test() { cout<<"In TEST destructor"<<endl; } }; int main() { Test t1; vector<Test> vec; vec.push_back( t1 ); cout<<"About to clear vector"<<endl; vec.clear(); } [/code] I suspect I'm missing something fundamental. When I …

Member Avatar for Dave Sinkula
0
2K
Member Avatar for Puckdropper

I've got a program to do for a class I'm taking. I've got most the code written but I can't get the two classes to play together like I want them to. Here is the relavent part of the assignment: [quote] A concordance is an alphabetical listing of all words …

Member Avatar for Puckdropper
0
690
Member Avatar for manishgurnaney

How Can i Create a final class in C++? i have tried by making constructors private . but i want to know an efficient way of doing this?

Member Avatar for Narue
0
85
Member Avatar for shantise2003

I am very new to this and i really need some help :cry: Objective: Understanding of static data types (arrays), traversals, searching and insertion into arrays. Description: In this assignment, you will create a game similar to that of 'Wheel of Fortune'. While the show itself lacks any real worth …

Member Avatar for Dave Sinkula
0
103
Member Avatar for msme

hi everybody I beg to say that I have three numbers. but i want to know that which number is random these are number 1 73163474394643734240 number 2 42651524357702920737 number 3 24965462478679919220

Member Avatar for Narue
0
226
Member Avatar for Toshkin78

Im having trouble sending a bool type to a function which returns a char string to a string. I have provided the code below [CODE] /* Name: bool2.cpp Copyright: Author: Toshkin Date: 06/09/05 21:56 Description: passing string to boolean function returning boolean to */ #include <iostream> #include <cstring> using namespace …

Member Avatar for Toshkin78
0
1K
Member Avatar for Dulaithol

Well, I'm writing a physics calc and I'm having problems. When my friend tries to run it, he gets this [url=http://www.kc8onw.net/~kelvad/images/untitled.bmp]error[/url]. I was wondering what piece of the code wants that .dll file. I think it has to do with the .rc file, but I could be wrong. I'm only …

Member Avatar for Dulaithol
0
257
Member Avatar for Quan Chi2

How would I make my command line program respond to what a user types in? Im reading C++ for Dummies at the moment, and I was wondering what I would do to make it respond to what a user types in. Example: I declare a variable. I start a new …

Member Avatar for Rashakil Fol
0
181
Member Avatar for karen_CSE

hi, I've been staring at my program code forever now and I'm going in circle. I don't know what I've done wrong. Can anyone please help? I'm supposed to design a month class that the following private members: 1) name: a MyString object that hold name of a month such …

Member Avatar for Ancient Dragon
0
915
Member Avatar for kahaj

[code] //Clifton Copeland //Excercise 6.27 //This program outputs Fahrenheit and Celcius range charts. //C = (F-32)*5/9 //F = C*9/5+32 #include <iostream> using namespace std; int cTable; int fTable; int main() { cout << "Choose which table you would like to display." << endl; cout << "Press C for conversions to …

Member Avatar for Dave Sinkula
0
131
Member Avatar for server_crash

For some reason this code is not correctly displaying the output....Is it a compiler issue? I'm not getting any affect from the width method, nor from the fill method. However, when I include <iomanip> and make a call to setw(int) then it works, but this code doesn't: Code: #include <cstdlib> …

Member Avatar for server_crash
0
122
Member Avatar for ramcfloyn

Hello, anyone familiar with ansiString? Have a problem involving a string "1 1", should read "11". I want to get rid of the space in the middle. Can't change it to a character string or std::string so that isn't an option. Will i have to compare each character inturn with …

Member Avatar for Ancient Dragon
0
356
Member Avatar for Micko

Hello, I've been reading Narue's Timesaving Tips and found this code from Dave Sinkula [code] #include <iostream> #include <vector> #include <iterator> using namespace std; int main() { int a[] = {1,2,3,4,5}; vector<int> v(a, a + 5); vector<int>::const_iterator it, end = v.end(); for (it = v.begin(); it < end; ++it) { …

Member Avatar for Dave Sinkula
0
107
Member Avatar for Acidburn

How good do you have to be in C++ / C in order to enter the world of Open GL?

Member Avatar for wally_lawless
0
171
Member Avatar for j1979c

Hi :o , I would like to know if it is possible to write a console program in [B]MS Visual C++ 6.0 [/B](ATM transaction program), that stores data to a database such as [B]MS Access 2002[/B] or [B]Oracle 9i[/B], through [B]ODBC[/B] :?: I've searched all over the net and I …

Member Avatar for Ancient Dragon
0
171
Member Avatar for kdw3

I'm writing a basic piece of code to perform a successive approximation algorithm, however, when it runs the approximation loop, it seems unable to distinguish between a positive and a negative number in that it runs both if statements. The code is shown below, and if someone could point out …

Member Avatar for Dave Sinkula
0
153
Member Avatar for NagendraR

Hello All, I am trying to convert structures to Byte stream(Serialization). I have one concept, Now I am converting each structure object to char pointer, but for structures with pointers this logic wont applicable. can any one help me with any logic for serialization in C/C++

Member Avatar for Narue
0
246

The End.