49,757 Topics

Member Avatar for
Member Avatar for bookmark

Hi, I'm having a problem with this program. When I choose an option, all the program does is output three random numbers with letters in them. Do any of you know what my problem is? Any help is appreciated. Thanks for taking the time to read my program. - bookmark. …

Member Avatar for bookmark
0
133
Member Avatar for Nathaniel10

This is part of my Wumpus Hunt program. Suggestions were to clean up the main() part of the program by creating functions. I am working on that and ran into this difficulty (for me). The functions that relate to the rooms of the game need to return an array. I …

Member Avatar for arshad115
0
226
Member Avatar for arshad115

Hi,I want to copy a few files to the Windows\winsxs folder ,but in windows vista/7 you cannot write files to that folder, apparently there is a user called "TrustedInstaller" only that user has write access to the folder. TrustedInstaller > Administrator. I tried to use "runas" for my process but …

0
88
Member Avatar for merse

If a double is initialized with 3.0 than we get an exact double, I mean 3.0 is an exact binary number, therefore 3.0 has no error during the conversion. But for example 0.1 is not an exact binary therefore the number (double)0.1 has error in its last digit. I would …

0
70
Member Avatar for realproskater

So i need help doing this project and heres what i have to do for the program i left some comments on what my code does etc, please help. Write a program to compute the square root of a number. DO NOT USE any math libraries in this program. You …

Member Avatar for mtbs1826
0
684
Member Avatar for cwarn23

Hi, I'm writing a large program but require Multithreading for this software. I've searched the web for just over an hour and now is just after midnight but still can't find anything simple. The only thing I saw that came close to what I need was at [URL="http://www.computersciencelab.com/MultithreadingTut1.htm"]http://www.computersciencelab.com/MultithreadingTut1.htm[/URL] but I …

Member Avatar for Ancient Dragon
0
704
Member Avatar for tKc

i have my program outputting a number grid that is nxn. i have it using a 2d array to output my grid but the issue im having is that when the user wants to input a number that is in the nxn grid, the value is not being replaced by …

Member Avatar for WaltP
0
209
Member Avatar for jnick12

Can anybody tell what I need to do to make this program restart after it finishes without having to exit? Some kind of loop or something...??? [CODE]#include <iostream> using namespace std; int main () { double operand1, operand2; double sum, difference, quotient; char choice; cout << "\n\nBASIC CALCULATOR\n" << "a. …

Member Avatar for WaltP
0
1K
Member Avatar for jnick12

How do I validate that the input from the user is a number and nothing else within each case? [CODE]#include <iostream> #include <cstdlib> #include <iomanip> #include <limits> using namespace std; int main () { double operand1, operand2; double sum, difference, quotient; int exit = 1; char choice; while (exit == …

Member Avatar for WaltP
0
1K
Member Avatar for Tyster

Hi folks, I'm quite new to C++ and I'm getting an exception I don't understand. I have a class named 'Rational' that performs calculations on fractions. It has a default constructor as follows... [CODE] //In Rational.h public: Rational(int num = 1, int denom = 2); //Default constructor void addition(Rational); void …

Member Avatar for mike_2000_17
0
159
Member Avatar for merse

I hate when I have to acces a class data member like myclass.get_x(); I would like to simply write myclass.x; But I also want to stay with private x, I just want to read like myclass.x, but dont want overwrite it. It is somehow possible?

Member Avatar for mike_2000_17
0
137
Member Avatar for olive405

i already did not turn in this lab but it is killing me. tell me why I am getting so many errors.... //This is the most confusing program in the world. I was not trained //correctly for this. But as long as the proffesor gives me the code //i can …

Member Avatar for invisal
0
134
Member Avatar for networkZombie

I'm trying to make a program that tells you how much of each type of bill or coin you will receive as change after you enter the total amount of goods you are buying and the amount you are paying with. But my program takes in the total amount of …

Member Avatar for networkZombie
0
202
Member Avatar for chuck577

I am finally learning about fstream but Im stomped with this problem that I have. I have a current file that I am opening. Each line of said file looks like this: D40001~10997~811~DANIWEB~555-555-5555~7.70~I~2111 There are around 5000 lines with different DXXXXX numbers. I want the user to input a dnumber …

Member Avatar for frenzy50187
0
1K
Member Avatar for baldwindc

ifstream mystream(file_name); ofstream outputstream(filename, ios::out); do { mystream.getline(line, 100); mystream >> country_name >> happiness_value; total_happiness = total_happiness + happiness_value; count++; outputstream << country_name << " \t \t " << happiness_value << endl; } while (!mystream.eof()); the file ifstream is reading from is a .dat file, in this format: first 1 …

Member Avatar for baldwindc
0
1K
Member Avatar for general lee

ok i have to write a program that takes six test scores as input and stores them in an array. It drops the lowest score, and computes the average of the remaining five scores. It outputs the average score rounded to one decimal point. This is what I have and …

Member Avatar for general lee
0
76
Member Avatar for missil9

Hey all, I am a relatively new programmer and am trying to use Boost regex for my program. My code is: [CODE]#include <boost\boost\regex.hpp> using namespace std; double scrape( string base, string match ) { boost::regex re(match); boost::smatch matches; string::const_iterator start; start = base.begin(); while( boost::regex_search( start, base.end(), matches, re ) …

Member Avatar for missil9
0
263
Member Avatar for geryin

Write a function that accepts an array of integers and determines the product of each two integers. Although you can create a fixed size array in main, your function should work no matter what size of array is passed to the function. MY code: [CODE]#include <iostream> using namespace std; void …

Member Avatar for Lerner
0
96
Member Avatar for petrkotas

I am not sure if this is more software problem or C problem. Nevertheless, I am trying to run simple test code to check if my lapack installation is OK. [CODE]#include <stdio.h> #include <atlas_enum.h> #include "clapack.h" double m[] = { 3, 1, 3, 1, 5, 9, 2, 6, 5 }; …

0
87
Member Avatar for fat0ali0ma
Member Avatar for Urv73

I have a program that lets me enter participants in a race, their startingnumber, their start time and end time. The program then tell me who won the race and the winning time. This is my program: [CODE] #include <iostream> using namespace std; int main () { int start_Nr, start_Hour, …

Member Avatar for Urv73
0
169
Member Avatar for Syrne

Okay so I have a program that takes in up to 25 students and information for each including 5 test scores. All of that is done and working fine. What I am trying to do now is calculate the averages of each test 1-5 and then the total average of …

Member Avatar for StuXYZ
0
272
Member Avatar for dstaner

Hello, I'm just learning C++ and I'm getting an error with a program that is driving me nuts, and I'm not exactly sure how to resolve it. Can anyone help me? [QUOTE] AreaCalculator.obj : error LNK2019: unresolved external symbol "double __cdecl AreaOfTriangle(double,double)" (?AreaOfTriangle@@YANNN@Z) referenced in function _main \\.psf\Home\Documents\Visual Studio 2008\Projects\AreaCalculator\Debug\AreaCalculator.exe …

Member Avatar for dstaner
0
480
Member Avatar for geryin

Write a function to compute the value of the following series. f(x, y) = y( ((1/1) - (1/3)) + ((1/5) - (1/7)) + ((1/9) - (1/11)) ... + (1/(4x-3) - 1/(4x-1)) ) where the values x and y are given by the user. The main function should continue to query …

Member Avatar for frogboy77
0
86
Member Avatar for MichaelSammels

Hey there, all. I just complied a program in C++ on Microsoft Windows 7 Ultimate (MinGW). The only problem is that when I run it a command prompt also runs with it in the background, and can't figure out how to remove it. Any ideas?

Member Avatar for MichaelSammels
-1
193
Member Avatar for TinhornAdeniyi
Member Avatar for hardit_marwah

[CODE] i am a 13 year old stuck at this, someone please help me out!! i have a problem defining a character variable its giving the error lvalue required #include <iostream.h> #include <conio.h> void main() { clrscr(); char name [20]; cin >>" Your name please...", name; if (name="john") //over here!!! …

Member Avatar for Ancient Dragon
0
72
Member Avatar for MrJNV

I have a struct as follows: [CODE]struct Database { int accountNum; double balance; int months; };[/CODE] I want to make a vector of this struct, because I want the size to vary. How do I do that? Thanks in advance

Member Avatar for Fbody
0
96
Member Avatar for slavacrilov

I have a program that requires to reverse the name which is a string, here's the code... it's suppose to work, no errors found.... but "Run time error" [CODE] int i = fullName.length(); while (i>=0) { cout<<"Your reversed full Name is: "; cout<<fullName.substr(i-1, 1); i--; } [/CODE] thanks

Member Avatar for slavacrilov
0
105
Member Avatar for cperepelitsa

It's probably obvious that I'm more familiar with Python than C++... I was wondering if there's a convenient way of storing objects / miscellaneous STL structures on the hard drive for later importing and use in C++ in the same manner that Python does with the Pickle module. I know …

Member Avatar for rts1
0
4K

The End.