49,757 Topics

Member Avatar for
Member Avatar for manofhouse

I cannot seem to correct the remaining errors in the code. This is the header [CODE]#ifndef DECIMAL_H #define DECIMAL_H #include <iostream> using std::ostream; using std::istream; // class Decimal definition class Decimal { public: friend istream operator>>( istream &, Decimal & ); Decimal( double = 0.0 ); void setInteger( double ); …

Member Avatar for gerard4143
0
189
Member Avatar for toferdagofer

Im having problems with my input validation. Its not working correctly. Keeps repeating the validation loop even when i enter something that should be correct. basically im trying to make it so that the only valid answer is either uppercase or lower case letters a-d. [CODE]#include <iostream> using namespace std; …

Member Avatar for Lerner
0
149
Member Avatar for miha2

Hello. So, I'm a newbie, and this is my second hard assignment. In this assignment, I have to decrypt the message from the teacher (well, not only this, it should open and decrypt any text file). So, the example line would be: [I][B]Ftq Pqoxmdmfuaz ar Uzpqbqzpqzoq ar ftq Ftudfqqz Oaxazuqe …

Member Avatar for miha2
0
722
Member Avatar for MasterGberry

I have a feeling my logic is off here.....crashes randomly depending on input [CODE]//Exc_6.cpp - practice with arrays #include<iostream> using namespace std; void fillArray(double array[], int size); void showArray(const double array[], int size); void reverseTheArray(double array[], double reveseArray[], int size); int main() { int size; cout << "Please enter the …

Member Avatar for MasterGberry
0
90
Member Avatar for hiddepolen

Hi guys, I need some help with sprintf. I get the general idea, and I think everything works, but my MessageBox will not diplay the right text. [CODE]int a = 25; char buf [80]; sprintf(buf, "%d", a ); MessageBox(NULL, (LPCWSTR)buf, L"Sel Change", MB_OK);[/CODE]

Member Avatar for hiddepolen
0
130
Member Avatar for TinhornAdeniyi

This is supposed to be a code for a video game store [CODE]#include<iostream> #include<fstream> using namespace std; ifstream infile; struct VideoGame { string Name; string Genre; string Publisher; string Developer; string Platform; string Price; int count; VideoGame *link; }; void CreateList(VideoGame*& first, VideoGame*& last); void CheckOut(VideoGame*& first, string title); bool …

Member Avatar for TinhornAdeniyi
0
231
Member Avatar for burcin erek

i made a class test program with telephone directory. it writes name and telephone number but not surname i have used return name,surname which does not carry both string. is it possible to do them without writing another function script. thanks in advance [CODE]#include <cstdlib> #include <iostream> using namespace std; …

Member Avatar for jonsca
0
99
Member Avatar for vbx_wx
Member Avatar for SgtMe
0
56
Member Avatar for wrhurst

Hello all, I want to change the following code to have the user enter ANY NAME to see if the person is present in the array. I'v been trying for a couple hours now but keep getting errors. There's more to this problem but I have to get past this …

Member Avatar for wrhurst
0
167
Member Avatar for wdearth

I'm supposed to create a bill for a catering group utilizing at least two functions, which functions could I use for this and how will I use them? I've done it with mainly if and else statements and simple calculations, any functions I can use? #include<iostream> #include<iomanip> #include<string> using namespace …

Member Avatar for mtbs1826
0
224
Member Avatar for .:Pudge:.

Alright so I have to create a B-tree of order 'n', where the user puts in a desired 'n'. I borrowed and modified code of a B-tree of order 5, but I can't get it to work and it crashes. I also need it to display the contents of the …

Member Avatar for .:Pudge:.
0
149
Member Avatar for theUserMan

Hello all, First time user on this web forum, I'm having problems with this function I'm building So I need to read in all the data for one movie from a text file that contains several movies text file looks like this 7 8.9 1993 281646 D 195 Schindler's List …

Member Avatar for theUserMan
0
153
Member Avatar for Jaily

Can I somehow use the following code to remove all the elements of a binary tree? [CODE] void BinarySearchTree::remove(int d) { //Locate the element bool found = false; if(isEmpty()) { cout<<" This Tree is empty! "<<endl; return; } tree_node* curr; tree_node* parent; curr = root; while(curr != NULL) { if(curr->data …

Member Avatar for nbaztec
0
2K
Member Avatar for kyros

hello everyone.I have a question. I saw this question in a site and tried to solve this but I have no idea can you help me? Write a recursive function (use no while loops or for loops) that prints all the elements of an array of integers, one per line. …

Member Avatar for Lerner
0
168
Member Avatar for merse

It is possible to exploit the built in floating point arithmetic of the processor without using the standard C++ built in floating point data types?

Member Avatar for mrnutty
-2
94
Member Avatar for KellieD

Hi, Okay, I really need help with this program please... I have to create a program which; Contains a function called sumN() which takes an int n as an argument and returns an int which is the sum of all integers between 1 and n. In the main() it asks …

Member Avatar for KellieD
0
98
Member Avatar for rageplant

I have a problem that I am working on, and it is to find the shortest path on a grid, when you are given a start point, an end point, and a list of obstacles. I managed to set up a grid by using a vector of vectors, but I'm …

Member Avatar for alwaysLearning0
0
227
Member Avatar for ChaosKnight11

Hi. I am working on a visual C++ app and I was wondering if it is possible to use PostgreSQL for database interaction instead of the default SQL Server? I saw a connector for .NET but it's written in C#, will that work for a C++ app also? Or is …

Member Avatar for Stefano Mtangoo
0
324
Member Avatar for knifty09

I haven't needed to use fscanf before, so I'm not very familiar with it... Everything is working fine except that the numbers it inputs are not what's in the file and they are all the same number (-9.255959e+061 to be specific) I know exactly how the files are formatted they …

Member Avatar for jonsca
0
105
Member Avatar for Ultraviolet

I'm trying to use this code to grant the current user full permissions to access System Volume Information: [CODE] //It works when manually written in cmd cacls "E:\System Volume Information" /t /e /g %username%:F //but using this formula to make the command window hidden does not work(doesn't give the permission …

Member Avatar for Ultraviolet
0
160
Member Avatar for keweul

[CODE] #ifndef POLYNOMIAL_H #define POLYNOMIAL_H class Polynomial { public: Polynomial(); Polynomial(int ,int []); ~Polynomial(); const Polynomial operator+(Polynomial& p) const;// addition const Polynomial operator- (Polynomial& p ) const; // subtraction int getExponent(); //void setExponent(); void setCoefficient(); int getCoefficient(); void printPolynomial(); private: int exponent; // exponent int coefficient[ 10 ]; // coefficients …

Member Avatar for cppgangster
0
4K
Member Avatar for cortez716

Okay heres the background on the code. I've written a code that prints a 10x10 array or random numbers. Then prompts the user to pick a number. After user picks a number, the program then tells user the number of times number was found in the array and supossed to …

Member Avatar for vanalex
0
205
Member Avatar for narunaru

Hi, i'm a beginner software program developper ( i don't have advance knowledge on c++!!). I'm trying to make a gettime function where the program displays something like this: Monday October 2, 2009 10:34 am I know that constants needs to be declared, and I need to multiply 60 (number …

Member Avatar for ixmike88
0
90
Member Avatar for smeghead007

ok guys one quick question for you. If im reading a file say formated like so.. 123 d52.55 w52.66 d55.55 d66.66 456 w55.55 d55.55 d66.6 and i want to read the first variable so 123 and match it up with another file. how do i go about reading the rest …

Member Avatar for SgtMe
0
192
Member Avatar for chode1

#include <iostream> #include <fstream> #include <iomanip> #include <string> #include <ctime> using namespace std; void pickword (); int wordlength (); void printout (); void gameplay (); void totalgames (); void replay (); int main() { string guessed=""; string scaffold_top="______"; string scaffold_pole=" |"; string scaffold_bottom="_|_____"; string names[350]; ifstream infile; infile.open("smaller2.txt"); int counter; …

Member Avatar for SgtMe
0
151
Member Avatar for .:Pudge:.

My code works fine for smaller integers, but when it gets over 1 million or so the number changes or goes negative. I am sure this has to do with the range of int, but I tried float and double and all the numbers came out the same...... What is …

Member Avatar for .:Pudge:.
0
138
Member Avatar for Alec0905

Hey Guys, I had a question earlier about some bounds and i've got it all figured out after some intense debugging and some help. I just have one more simple question and I think I should finally be on my way. If I have a recursive function that returns an …

Member Avatar for Alec0905
0
199
Member Avatar for Gumbo

Hi I'm doing an assignment on Rational Number calculations. I'm getting some compiling errors which I don't know how to fix. Here is the error message and the code is beneath the error message. I would really appreciate if someone could read over this and see if you know whats …

Member Avatar for Gumbo
0
183
Member Avatar for achieve_goals

Hi, I am trying to make a word counter, for that I have to input a string line untill '@@@' character is entered. My problem is that when I enter "Hello hello" as my input it reads the last hello twice.. or this is what I think it does.. Right …

Member Avatar for achieve_goals
0
290
Member Avatar for Bri426

I'm working on a program for my C++ class. The assignment uses a file that includes student names and three test scores. For example: Name Test1 Test2 Test3 Name Test1 Test2 Test3 My teacher wrote the main part of the program for us and we are to write the functions. …

Member Avatar for Bri426
0
170

The End.