49,757 Topics

Member Avatar for
Member Avatar for kchyn

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 …

Member Avatar for Valaraukar
0
245
Member Avatar for neoraghav

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 …

Member Avatar for mike_2000_17
0
2K
Member Avatar for aviavyne

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 …

Member Avatar for mike_2000_17
0
284
Member Avatar for umairqureshi_6

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 …

Member Avatar for umairqureshi_6
0
511
Member Avatar for Gajewa469

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 …

Member Avatar for Stefano Mtangoo
0
130
Member Avatar for ezkonekgal

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 …

Member Avatar for Valaraukar
0
117
Member Avatar for ccube921

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 …

Member Avatar for Stefano Mtangoo
0
71
Member Avatar for cortez716

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) …

Member Avatar for Akill10
0
174
Member Avatar for nativeoak

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, …

Member Avatar for Greywolf333
0
144
Member Avatar for cortez716

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... …

Member Avatar for VernonDozier
0
122
Member Avatar for I_am_barrage

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 << …

Member Avatar for I_am_barrage
0
206
Member Avatar for rodel~

how can i make a basic calculator on turbo c++ that the result is can be used again and again to any operation

Member Avatar for prvnkmr449
0
83
Member Avatar for cogitoergosum18

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 …

Member Avatar for prvnkmr449
0
240
Member Avatar for ezkonekgal

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?

Member Avatar for prvnkmr449
0
108
Member Avatar for jorgempaz

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 …

Member Avatar for jorgempaz
0
155
Member Avatar for 4824hbk

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 …

Member Avatar for mike_2000_17
0
98
Member Avatar for Peram

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 …

Member Avatar for Peram
0
148
Member Avatar for cogitoergosum18

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; …

Member Avatar for VernonDozier
0
249
Member Avatar for kakaliki

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 …

Member Avatar for VernonDozier
0
568
Member Avatar for praky

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; …

Member Avatar for praky
0
88
Member Avatar for chinchan

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

Member Avatar for Colezy
0
203
Member Avatar for Defensor

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 …

Member Avatar for Defensor
0
202
Member Avatar for bmos31

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 …

Member Avatar for bmos31
0
1K
Member Avatar for lukename

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 …

0
56
Member Avatar for gurram srinath

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 …

Member Avatar for frogboy77
-2
105
Member Avatar for Rikard

Hallo! I've been having some trouble getting a save/load function to work properly. I'm trying to save object and their properties to a file in binary using fstream. And then being able to load the object from the binary file the next time im running my project. Quick breakdown: I …

Member Avatar for Rikard
0
204
Member Avatar for rcplguy15

hello, I wanted to ask you all a question. suppose that my c++ program has read from a text file a set of characters like the one below using the command inData >> temp. i output the characters of the text file and stored all the characters in a string …

Member Avatar for rcplguy15
0
329
Member Avatar for medopunsher

Hey all , I'm writing a Windows program & i'm having a very silly and annoying problem. I Create a very simple Dialog(It's a window actually) with one text box and one button , then i try to use SetFocus() function to Give the focus to the text box so …

0
49
Member Avatar for sniper6560

this code is for bessel function Y n (x) 2nd kind I'm in the level 4 at computer engineering my prof. gave me that assignment , I want help to improve it to get an accurate results thanks!

Member Avatar for sniper6560
0
1K
Member Avatar for dmh22

OK, here is my dilemma, I am trying to read an input file into 3 arrays. The file must be formatted as such (ie - with each value on a new row): 3 - n value for an n x n matrix 'a' 1 - a11 - Next n^2 terms …

Member Avatar for dmh22
0
127

The End.