General C++ Programming - February 2012 (Page 43)

Issue with conditions...
 
I have occured an issue. I need the following program to check if the result is integer, and exactly 1,2,3,4,5,6,7,8,9,10. I want it to return an error statemen...
[2 replies] Last: Thanks :) (by jumper007)
Am I explaining this concept correctly?
 
About allocating and deallocating memory. Here: #include <iostream> using namespace std; int main() { int index, amountInput; // The user's nu...
[5 replies] Last: Oh okay, thanks roberts :). I'll use indices next time then! (by Ryan Wilson)
basic AI for rock paper scissor shoe?
 
so i have a rock paper scissor shoe program that just guesses a random # between 1 and three and guesses randomly then compares it to what you r=used to see who...
[3 replies] Last: Awesome answer Gaminic. Now then,, where is the LIKE button!? (by Pravesh Koirala)
by cobalt
overload of >> operator
 
Hi! I've got some problems with overloading >> operator. I need to write a class which will satisfy such test code: stack S1, S2; (...) int a,b,c,d;...
[3 replies] Last: Quoting the FAQ-lite: 21.Don't overload an operator that is non-in... (by Gaminic)
by Gldnbr
Displaying a 2-dimensional array
 
I'm trying to display a graph with modified characters. So, when my function goes through the two-dimensional array, it replaces '1' with '#' and replaces '0...
[2 replies] Last: Ah, yes. Alright I got it, thanks :) (by Gldnbr)
For Problem ! Please !
 
F = G*m1*m2/r I need 1000 values to F. G, m1, m2 are Constants values, r change in a range to 0-1000 for example: r1 = 147000 r2 = 152000...
[2 replies] Last: Yeah ! Thanks lot man, I Prove it and it works PERFECT, this is what I... (by Michdav44)
by mrkhn
qsort function with predefined arrays
 
Hi all, hope someone can help me with this.. I have checked: http://www.cplusplus.com/reference/clibrary/cstdlib/qsort/ And now trying it with my class... I h...
[3 replies] Last: Solved int CInfo::compare(const void *a, const void *b ){ return 1;... (by mrkhn)
Help! Use a sentence, positive and negative output, For example:1 -1 . 1000 -1000 Can use a formal parameters,Can't use loop
 
Use a sentence, positive and negative output, For example : 1 -1 ...... 1000 -1000 Can use a formal parameters, Can't use loop Example, pictures address: ht...
[3 replies] Last: Your img shows even numbers + and odd number negative. How high are y... (by roberts)
Word parsing loop
 
Hi, I am trying to write some code that will parse a string into words based on actual letters only . So, for example, the string "Hello, my name3 is Leah." ne...
[3 replies] Last: This is completely untested : string theLine = "Hello, my name3 is Le... (by coder777)
Two dimension Vector / Reading Infile Writing Outfile
 
Afternoon Forum, So what I need help with is writing a program that reads an input file, data.txt, stores the information in a two dimensional vector and then ...
[1 reply] : Anybody? (by TrevorD)
Change Caculator
 
i am not getting right amount of change back. please help twenty = 0 twenty = aReturn / 20 aReturn = aReturn Mod 20 ...
[1 reply] : It looks okay to me. Have you tried using a debugger? (by Zhuge)
data files
 
Hey Guys i need your input here.. I created a data file example.dat which looks like: 34 12 14 23 23 54 2 32 67 1 56 7 12 2 67 Then i created a prog...
[1 reply] : See my response here: http://www.cplusplus.com/forum/beginner/60647/#m... (by roberts)
by Gldnbr
Checking if a button is pressed
 
I want to try something new today I've been wondering how to detect which button was pressed and then so something. For example, If I press the left arro...
[13 replies] Last: Nevermind, I got it (by Gldnbr)
QuickSort troubles
 
Hi, I have this quicksort but it's not running, any thoughts? It compiles, but I can't get it to run, it just crashes. //NB: need start and end to determine ...
[1 reply] : Read the wikipedia article on quicksort and then use the debugger to s... (by kempofighter)
by evb
rpcb_getaddr fails.
 
Why is my linker warning me "C:/cygwin/home/eb/rap00/main.c:94: warning: passing arg 4 of `rpcb_getaddr' from incompatible pointer type"? And yes, rpcb_get...
[no replies]
Letting User Choose ofstream.open
 
I'm trying to create a program that lets a user create a file through the terminal that also includes details such as the author, the intended target and a shor...
[no replies]
by rfrapp
Hex addition C++
 
I'm writing a program to add two hexadecimal digits, and I've come across a problem. It seems to add the number to the first digit. If i put in AB and 1, it wou...
[1 reply] : Can you show what the input arrays are? Are they something like this?... (by vin)
Skipping getline (cin, stringvar);
 
In my program when I ask the users to enter a username, target (fake) and message, it skips over the user's entry for the message when I use getline (cin, messa...
[4 replies] Last: The >> operator does not remove the end-of-line character that you ent... (by Galik)
Looping question
 
Alright, I have an assignment that tells me to do this: Write a program that asks the user for a number of hamburgers they would like to eat. The program sho...
[3 replies] Last: Nevermind...I had something misplaced, and I think I figured it out no... (by KaraPardue)
by sweezy
why wont this compile?
 
/ This program will calculate the prime numbers from 1 to 1000. #include <iostream> using namespace std; int main() { double first; // To hold the fir...
[5 replies] Last: cin >> first >> endl; ¿what do you want to store in endl? (by ne555)
February 2012 Pages: 1... 414243
  Archived months: [jan2012] [mar2012]

This is an archived page. To post a new message, go to the current page.