49,761 Topics

Member Avatar for
Member Avatar for rossie queen

hi everyone, i have a problem in converting the c++ language to c language. can anyone help me to do this because i just learn programming. #include <stdio.h> void choosePlay(char); void playGame(int,int,int,int); void match(int[][4]); int r1,r2,c1,c2; char comma; int cards[4][4]={{1,3,2,4},{4,2,3,1},{5,7,6,8},{8,6,7,5}}; void main() { char click; char newcard; cout<<"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"; cout<<"@ @\n"; …

Member Avatar for gerard4143
0
348
Member Avatar for mayank.dyl
Member Avatar for mayank.dyl
0
109
Member Avatar for RobBobSmith

Hello all, I'm having trouble with making a 2d vector array class. Would anyone have time to help with a couple of questions? I think my problem is with overloading (). I notice that this: [CODE]template <typename T> T& Array2d<T>::operator() ( int x, int y) { if( x >= rows …

Member Avatar for RobBobSmith
0
188
Member Avatar for BigBang5

#include <iostream> #include <cmath> using namespace std; int main () { int numMonths; double balance; double numBalance; float rate; double totDeposited = 0.0 ; double totWithdrawn = 0.0 ; double mthlyInterRate = 0.0; double totInterest = 0.0; cout << " Enter the initial balance ===> "; cin >> balance; cout …

Member Avatar for SgtMe
0
161
Member Avatar for Ace1.0.1.

I just want modify the program below to print + or - minus after the letter grade based on the last digit. [CODE]// Chapter 6 - Exercise 1 // A professor generates letter grades using /* 0 - 60 F 67 - 70 D 71 - 80 C 81 - …

Member Avatar for SgtMe
0
148
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
227
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
707
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
212
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
139
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
97
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
482
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

The End.