49,761 Topics
| |
Line 34 and 35 won't execute unless I insert them into the for loop. [CODE]#include <iostream> using namespace std; int main() { cout<<"Please enter an integer.\n"; int intege; int integ; for ( int inte = 1; inte = 1; ) { cin>> intege; cin.ignore(); cout<<"Please enter it again."; cin>> integ; … | |
When I press enter after the execution of the code, it doesn't terminate and tell me the process time etc. it just skips a line. [CODE]#include <iostream> using namespace std; int main() { cout<<"Please enter an integer.\n"; int intege; int integ; for ( int inte = 1; inte = 1; … | |
I have created a program that is based off the guess the number. But what ive added is a menu with four options 1 - 1 player 2 - 2 player 3 - high scores 4 - end game. Now I have the two combined at which im sure it … | |
I am using VC++ 2010 and I am trying to use SFML 1.6. I am trying to create a simple window. I am using Release mode because debug never works I get the error shown here [url]http://img529.imageshack.us/img529/8281/captureers.png[/url] Release works, but when I close the window it gives me these errors: … | |
For all you experienced C++ developers, do you mostly develop windows applications? What's your IDE of chioce, the one you feel is best suited for such development? Would that be Visual Studio 2008 (or 2010, since that is the latest) or something else - like Eclipse or Netbeans? | |
Hey, I have a generator but it works dependently on time, so it makes new values only every second. Is there a way to make it work faster? I want to be able to generate new numbers every millisecond if possible. [code=C++] srand((unsigned)time(0)); int a; int b; int c; int … | |
Hi, I'm new to pointers. i got some requirements...... Following is my requirement.........i want to use a double and triple pointer array [2D,3D] and in that double pointer i want to get data from the user.how can i achieve that using malloc and free for assigning and deallocating memory. im … | |
Hello, I started c++, and I recently got an assignment, which is supposed to calculate the sum, variance, mean deviation, and mean in a set. The user can input any number positive or negative for the set. Because it is a set, the person may enter as many numbers as … | |
Need help from u all am a newbie here!!! making a 2D project, snap link is given below [url]http://i238.photobucket.com/albums/ff224/umairqureshi_6/back.png[/url] here i have to blast the ship which is moving downward on x-axis with a cannon ball ,on the mountain the function i am using for projectile trajectory is ---------------------------------------------------- void … | |
I am trying to figure out a way to use maps to keep a total number of items. I was using arrays before [CODE]total[x] = total[x] + (function to add another int);[/CODE] Now I made total a map, but have no idea how to get the same result. Gives me … | |
my desired output is this: Input number of process to simulate SJF: 4 Input burst time for each process: P1 = 7 P2 = 4 P3 = 1 P4 = 4 Input Arrival Time for each process: P1 = 0 P2 = 2 P3 = 4 P4 = 5 Now … | |
I don't know why my compiler didn't like my for loop [CODE]#include <iostream> using namespace std; int main() { cout<<"Please enter an integer.\n"; int intege; cin>> intege; cin.ignore(); cout<<"Please enter it again." for ( int inte = 1; inte = 1; ) { cin>> integ; if (intege==integ) { inte=0 cout<<"Thank … | |
Here's what Im trying to do... Write a program that asks the user to guess the next roll of a six sided die. Each guess costs $ 1. If they guess correctly, they get $ 100.00. The player will start out with a $10.00 bank. Each time he (or she) … | |
I am trying to pass a two dimensional array to a function and modify it. I understand that two dimensional arrays are automatically pass-by-reference parameters so that solves half of the problem. However, when I try to compile the code: [code=c] #include <cstdlib> #include <iostream> using namespace std; int x, … | |
I've writen a simple calculator code it is pasted below. What do I need to change in order to make it loop using a "while" statement until, the user inputs the letter ("Q" upper or lower), casuing it to exit the program instead of a function such as(/,*,-,+).. please help... … | |
I'm working on this project and I'm REALLY close, I'm just gettin a C2059 error and I have no idea why? [CODE] #include <iostream> using namespace std; int main() { int guess; int die; float total = 10; char ans; cout << "Welcome to Dice Roll!" << endl; cout << … | |
how can i make a basic calculator on turbo c++ that the result is can be used again and again to any operation | |
i can see the light at the end of the tunnel after working on this thing for 6 hours strait but i am faced with a last few errors. First here is the code: it is really long. the error statements are: 'seriesParallel' : undeclared identifier seriesParallel' : undeclared identifier … | |
i have declared [CODE] char arr[10][10]; [/CODE] and did this: [CODE] for(i=1;i<=n;i++){ arr[i] = (char)i; } [/CODE] but it wouldn't work.. i want to put the number inside the array.. y does this error? | |
The program at work now will end up in a drawing third dimension editor. I draw in the window but when I touch a window's control (a menu option, maximize, minimize buttons, other window, etc...) the image at window disappears, do I have to redraw everything? if so, which controls … | |
Here are the two functions that I'm trying to get to work together. Anyone know how to call my overDraft function into my withdraw function if statement? Thanks. bool withdraw(double amt, int pin){ if (amt <= bal) return true; if(amt >= bal) return ????; //Need this to call my overdraft … | |
For some reason, it works when I just do the entering the name part it works fine, but with the rest of my program I'm having a problem. I'm trying to have the program make it where they enter a password to get in the program (Which I got to … | |
I am trying to write a function that relates a color; for example, brown with a number, say 1. so when the user types brown 1 will appear, etc. [CODE]int colortonumber (int x) { int nka; switch (x) { case 'brown': nka=1; break; case 'red': nka=2; break; case 'orange': nka=3; … | |
Write a program that illustrates the growth of the world's population using as input: the start year the initial population size the annual percentage increase of the population the end year. You may assume that the input is valid. Output the year, the size of the population and the population … | |
I am writing a code for arithmetic compression. But my problem is i can't open the file 2nd time for reading. code is: [CODE] #include<iostream> #include<fstream> #include<stdio.h> #include<math.h> using namespace std; #define MAX_SYM 255 struct node { char ch; int count; /*public: node() { //cout<<"constructor at work. \n"; count =0; … | |
hii all , I need to assign either 1 or -1 randomly to an 3 dimensional array where 1 corresponds to orange and -1 corresponds to blue can someone help me in C++ code Thank You, chin | |
Hello everyone. I am trying to copy data from a file stream into a char*. I know there are ways to do it with std::string and getline, but I have an assignment where I have to have a class that will take a char* into one of its constructors (which … | |
So I'm having trouble performing a linear search of a linked list class. The inList() search function is supposed to recieve a value for an element and search for that element, return a bool value based on whether or not the value is in the list or not. Below is … | |
Hello guys. I have some problems with ofstream and CFileDialog. I use this code to get file location: [CODE]CFileDialog fileDlg(TRUE); if (fileDlg.DoModal() == IDOK) { FilePath = fileDlg.GetPathName();[/CODE] And after that i try to write something to file wich don't exists. So ofstream have to create a new one. [CODE]std::ofstream … | |
to prepare a serial version of a program to illustrate patterns of Gator fan coloring. Gators are fond of the colors orange and blue. They tend to dress in either one color or the other and frequently change their minds about their color based on the colors of the people … |
The End.