49,755 Topics

Member Avatar for
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
89
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
128
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
225
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
217
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
148
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
167
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
217
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
89
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
150
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
137
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
198
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
248
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
Member Avatar for Alec0905

Hey guys, i'm working on a recursive problem that invlolves getting from a place "s" (start) to a part "e" (end) in as few moves as possible. There are road blocks "x" and the grid is a size up to 15x15. My problem is that when I try to write …

Member Avatar for Alec0905
0
162
Member Avatar for geryin

Write a function that accepts an array of integers and determines the difference between the integers. For example, if the array [3 7 8 13 11] is passed to the function, it prints to the screen [3 4 1 5 -2]. mine give me : 3, 4 ,4 9, 2 …

Member Avatar for Duoas
0
2K
Member Avatar for thisischris

So I have a data file that looks like this [CODE] Movie1 Year Salary Actor1, Actor2 Movie2 Year Salary Actor3, Actor4, Actor5 ... etc [/CODE] The part that's throwing me off is the actors line. It can have from 1 to 5 actors on it, separated by commas. I have …

Member Avatar for Duoas
0
131

The End.