49,761 Topics
| |
Hello, I'm almost done with this program, but when I want to sell an item (option 2) I get an error after I enter how many 'vector subscript out of range'. The program compiles correctly, but I cannot for the life of me figure this one out. Any Help? [code] … | |
How do i read in an equation in this format: 1 + 2a + 3b + 4c? I need to extract only the value 1, 2, 3, 4. | |
Hello, ive recently been making a program, and am trying to do some file i/o so that it can log information. Ive been trying to do it via a class. Well, i ran into a problem just clearing the char arrays (for my purposes they need to be cleared to … | |
hi i have a dialog based application with edit box control...i know how to save the data from the edit box to a certain file.and open it again (but i need to open the dialog and press the open button and choose the file then ok)... it is along way. … | |
I'm trying to code a program that compares multiple values of two variables (CI and CF). CI contains one variable that can have 1 of 10 values, and CF contains variables which must be solved themselves (and one of these containing a variable that can have 1 of 3 values). … | |
Hi all. I'm having a minor problem with cases in my program. If I enter a number that is out of my case range (say I enter a 10 when there are only 4 cases) I've got my default to output an error prompt. When I enter a character, say … | |
I'm trying to create 1000 random numbers using an array. I keep getting the same number everytime, though. How do I get 1000 different random numbers? Here's what I have so far: [CODE][LIST=1] [*]#include "stub.h" [*]int main() [*]{ [*] int number[1000], i; [*] int r[1000]; [*] [*] for(i=0; i<1000; i++) … | |
I have a visual studio 2005 form application. I also have created a header and source file with gets and sets and private variables for some of the data. How do I pass this data between forms? Ive looked at delegates but am having trouble understanding, is there another way, … | |
Thats the first time i started mess whit differents projects, and i got lost whit some things...very noob by the way... first, in a windowed project, i noticed my couts are not showed in the screen, so, how i supose should test my code? to see the result of variables, … | |
ok so i know all there is to know with text programming in c++. now i need to know how to give my program an interface. you know, like not using the command prompt any more.:S | |
Is there a way to chose where a program outputs text to a file ?(or read text from a file). As in selecting which line to start from.? Any help is welcome. :) | |
Does anyone know how to convert a "String^" data type in a visual studio 2005 forms app to an "int"? Ive tried atoi and casting to no success. Any ideas? Thanks. | |
i need help in c++ program I'm asked to make a phone book which can sort all the names in it alphabetically plllllz i need help | |
Write a C++ program ,that uses modularisation. The program allows the end user to enter a test mark which is converted into persantage by a particular funtion, the test mark is returned to main(), another funtion is called which detemines whether the student passed or failed if ist a pass … | |
I just found a tutorial that teaches how to change the transparency of a text box with an Increase transparency and Decrease transparency button. I tried to work it but then realised the code was meant for C#. I am just wondering what code I would use to change the … | |
Hi there, I've been writing in c++ for a little while now and am starting to feel more confident, I've noticed a possible error in a game I've been making, it is that when the player is inputting a character name, it is a possibility that they may put in … | |
Hey All - i working on a assignment for school. Given that, i would like to say i have attempted numerous ways to get this working, and its a simple part of teh assignment. Basically i am having problems with my 'insert node' method. I am unsure how i have … | |
[code] double two( double, double); [/code] if the parameters are 17.5 and 18.3, what will it return? Please help | |
[code] int test(int, char, double, int); double two(double, double) char three (int, int char, double); [/code] I need a statement for the function test with the actual parameters 5, 5,7.3, and 'z' please help | |
[code=cplusplus] #include<iostream> #include<vector> using namespace std; int main() { const int TYPE_OF_FISH=4; vector<Fish*>FishVec(TYPE_OF_FISH); FishVec[0]=new AustralianBass(); FishVec[1]=new EelTailedCatfish(); FishVec[2]=new GippslandPerch(); FishVec[3]=new ShortFinedEel(); cout<<"welcome for fish catching \n"; cout<<"press any to go out \n"; cout<<"keep pressing enter to get catch\n"; int i; Fish* aFish; char response; RandomInt d4(0,TYPE_OF_FISH-1); for(;;) { cin.get(response); if(response!='\n') … | |
Im trying to figure out how to utilise a program that uses Aggregation of Classes, Im having trouble calling the operations of the Classes in my main. Could anyone assist where Im going wrong?! horse.h [code=cpp] #include <iostream> #include "distance.h" using namespace std; class Distance; class Horse { private : … | |
I need a way to convert a variable to an int or to ascii code, tried atoi, static_cast, didnt work very well... The objective is to detect if the user inserted any character other than a number, a number smaller than 0 or larger than 5, and send a message … | |
Detail About Recursion and its Type Here I am going to give a detail about Recursion in C++. Definition: Recursion is the process where a function is called itself but stack frame will be out of limit because function call will be infinite times. So a termination condition is mandatory … | |
I am studying for a C++ exam and the study guide says "Be able to initialize arrays using literal arrays." Ok then, so I think well yeah that is easy, a literal array is something like.....Wait, I have no idea what a literal array is! From what I can find … | |
-- If you know of a shorter way to do this .. post away plz -- the nightscost and totalcost cause erros ( call to undefined function ) -- get a fair amount of warnings, but i can live with warnings [code=cplusplus] #include <iostream> #include "Thefunctions.cpp" using namespace std; int … | |
I have succesfully done this but with one error. using ... ifstream input("infile.txt",ios::in) while(input.good()) { input.getline(file,100); outputfile<<file<<endl; } then I have some new code that writes this into another file. You may laugh when you hear this but the problem is that it add an extra line to the output … | |
Hi all. I am having a hard time trying to properly declare a header for my assignment overload operator function. My prototype for the function is: [code] const BSTree<T>& operator=(const BSTree<T>&); [/code] And my attempt to write the header for the method is as follows: [code] template <class T> const … | |
This is my second time taking C++ course and I'm about to fail again since I'm barely hanging on with a C-D grade percentage. Here is the problem. I'm using the book "Beginning C++ Through Game Programming - 2nd Edition" and Dev-C++ to compile code. I'm not even majoring in … | |
[CODE] const SimpleCat * const FunctionTwo (const SimpleCat * const theCat);[/CODE] Ok so this is a function declaration. I'll pose my questions numbered so it is easier. I'm taking an online course in C++ but got stumped on this line of code. 1. The return type is of type SimpleCat … |
The End.