49,761 Topics

Member Avatar for
Member Avatar for silicon

Hello again everyone. We have completed a project after a few months and a lot of help but for some reason we are still having problems. The project compiles properly without errors but the results are incorrect. Basically we are using 4 sorting algorithms in order to calculate how much …

Member Avatar for Narue
0
115
Member Avatar for XxAndyxX

I have a project where I must use pointers to do a search on some accounts I've built up into a vector. My problem is whenever I try to pass the vector to a pointer I get an error. I've tried many different things but to no avail. Maybe one …

Member Avatar for Dave Sinkula
0
217
Member Avatar for MrNiceGuy82

I need a little assistance with finding the square roots of each number entered by the user in a array. I'll copy and paste what i have so far in my function, but i get an error when i try to run the program and it would say: sqrt was …

Member Avatar for Narue
0
2K
Member Avatar for rharvison

I need to insert a control-break in an array after every third line. Can someone help with this? Thanks so much. -R

Member Avatar for Dave Sinkula
0
238
Member Avatar for AhmedHan

I want to change cursor position in my C++ program. As you know, C++ does not have any command to do this. By I think, one of the h files can be used for this purpose. My Bloodshed compiler has lots of "*.h" files. But I don't know how to …

Member Avatar for Dave Sinkula
0
4K
Member Avatar for pink

I want to write a program.This program is following: The two text file named file1and file2 each hold number of English sentences.A c++ program is required to carry out the following operations. a.)Give a wrod ,it lists how many times that word appears in file1 and file2. b.)list all the …

Member Avatar for prog-bman
0
94
Member Avatar for jeymine

Hi Guys, Kindly help me Solve this. I have already worked on the classes that were inherited and attached after the question is the main part of my program. I have bolded the part in the question below where I need help. Thank you so much. The question is: Make …

Member Avatar for marinme
0
175
Member Avatar for jaeSun

ok, call me stupid, maybe i forgot my math: but if a C++ program spits out this: -bash-2.05b$ g++ markoff.cpp -bash-2.05b$ ./a.out x = 1 y = 1 z = 2 x = 1 y = 2 z = 5 x = 2 y = 5 z = 29 x …

Member Avatar for jaeSun
0
468
Member Avatar for mdbrock7

I am a complete newbie in C++ programming. After a very basic introductory class I am now reading a little more advanced book and trying to teach myself and I am slowly learning. Anyway, the book mentions a method for calculating the cube root of a number but it doesn't …

Member Avatar for mdbrock7
0
414
Member Avatar for Daywalker46410

I apologize up front; I'm a VB Programmer trying to pick up C++. I have a very simple program that takes a string input from the user. How can I look at a specific character in that string? VB has the Left(), Right(), and Mid() Functions. Is there something similar …

Member Avatar for Narue
0
3K
Member Avatar for steosaur(oWn)

i have a vector initialized without a size. vector<int> Vector1; i initialized the first 5 values via .push_back() and i am supposed to do this next: Externally initialize(using a single cin statement) the next four items to: 50 65 77 32760 This doesn't seem to work: cout << "Enter these …

Member Avatar for Narue
0
747
Member Avatar for tat2dlady

Can anyone help me with this snippet of code? I have 2 files, a random record containing random records in it and an index file, which contains the binary tree of the random record. Here is what the index file looks like: 123456720 4 -1 -1 123456708 6 -1 -1 …

0
46
Member Avatar for kittie

This program is calculating and displaying the average of 3 groups of numbers in output file. Data is arranged in file so each group of numbers is preceded by number of data items in each group. It works for 2nd & 3rd group but calculation for 1st group is wrong. …

Member Avatar for kittie
0
171
Member Avatar for amarigny

Hello, I am studying C++ at Uni and my coding is not very strong. More to the point I am having issues with my header taking in this string. The code works in a linear non object oriented code but as I am new to data abstraction I as mentioned …

Member Avatar for amarigny
0
195
Member Avatar for silicon

Hello, I was hoping that someone could help me with this question. We received an extra credit queston which completely bombed on. That wasnt the problem, the problem was that I still cannot explain the questions below and since this was extra credit the professor would not give us the …

Member Avatar for silicon
0
176
Member Avatar for kparnell

I got this assignment to do, but i cant so it, i have tried everything i know in C++ programming and its not working. Can someone help me please. Write a Graphical User Interface program that simulates the activities of a vending machine. The program should allow for full user …

Member Avatar for eagleeye
0
132
Member Avatar for Tetsu

Well I got the password code right, I think. I have a few problems 1) it wont close properly 2) Can someone point me in the right direction to find a tutorial that teach me how to only let the user have 34 tries before it close and also to …

Member Avatar for Tetsu
0
151
Member Avatar for Precis

So I need to write a program that requires getting data from an input file (first name, last name, Student ID, and 4 test grades) and create an outputfil with the first and last names and ID, and then the average of the grades and the final letter grade - …

Member Avatar for marinme
0
160
Member Avatar for bobr_1013

How can I use "cin" to allow entry of an enum type in C++? My code is as follows: enum Cards {TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, JACK, QUEEN, KING, ACE}; Cards hand1 = ACE, hand2 = ACE; cout<<"Player#1 - Pick a card (2 - A): "; …

Member Avatar for Narue
0
8K
Member Avatar for Layla_2401

Hi all, I have a C project consisting of five files as follows: main.c file1.c file1.h file2.c file2.h I have defined an array in file [B]file1.h[/B] as follows: [CODE]static struct prnc keys[MAXP];[/CODE] the array was populated in file [B]file1.c[/B] Now I need to use the contents of this array again …

Member Avatar for Narue
0
221
Member Avatar for JoBe

Hello ladies and gents, Ive got this example of a program that I tried out wich shows some special possibilities to use new. [code] #include <iostream> using namespace std; int main() { int a[100]= {0}; for (int i = 0; i < 100; ++i) a[i] = 100 * i; int …

Member Avatar for Fasola
0
272
Member Avatar for winbatch

What's the difference between a set and a map? (As described below on cppreference) Set: The C++ Set is an associative container that contains a sorted set of unique objects. Map: C++ Maps are sorted associative containers that contain unique key/value pairs. I'm having trouble finding the distinction.

Member Avatar for Narue
0
620
Member Avatar for RobertH

i am after help with c++ builder any takers i need info on the registry adding and changing keys thanks in aticipation Robert

0
85
Member Avatar for apcxpc

I've got to implement Prolog in C++ for an assignment. I'm very new to C++, it's a little daunting. Also, I have no idea of where to start. Can someone point me to some basic algorithm and/or some resources online?

Member Avatar for apcxpc
0
387
Member Avatar for winbatch

Hi, I've been experimenting with STL on solaris with the 7.0 sun compiler. I am able to write programs using string, map, vector, list, etc. however, I am trying to use hash_map and can't get the most basic (ie hash_map<string,string> h; ) to compile. It appears that hash_map is not …

Member Avatar for winbatch
0
212
Member Avatar for pink

I want to write a program.This program is following: The two text file named file1and file2 each hold number of English sentences.A c++ program is required to carry out the following operations. a.)Give a wrod ,it lists how many times that word appears in file1 and file2. b.)list all the …

Member Avatar for Narue
0
92
Member Avatar for csi_a_m

I am trying to close this file so that it stops reading the array twice. i have placed it in different places but i does not seem to work, please look at my code and advise me on were to place the infile.close() Thanks in advance [code]#include <iostream> #include <fstream> …

Member Avatar for Dave Sinkula
0
157
Member Avatar for Fasola

I kind of know the definition through studying Java.] Inheritance is like when a child class inherits some value, object, or function from a parent class, right? I need an example of how its done in C++

Member Avatar for wilsonian
0
403
Member Avatar for XxAndyxX

Okay, this is driving me insane... The compiler error I'm getting says I am trying to convert a void to an account? I don't see why it thinks I'm trying to do that... Maybe you guys can help me out. [CODE] void get_accounts(account a[], int n); int add_customer(account a[], int …

Member Avatar for Dave Sinkula
0
171
Member Avatar for ckrieger1

I need help. I keep getting a Bus Error when I run my program and I've narrowed down where it occurs to the following code fragment. px0c0 and px0c1 are type double pointers and count_x0c0[m] and countc0 are integers. Can anyone see why this code would be giving me a …

Member Avatar for Fasola
0
264

The End.