Beginners - February 2014 (Page 38)

Random number generator
 
Anyone good with random number generators? This is supposed to randomly generate the damage dealt by both player and enemy. It does that, but doesn't ge...
[8 replies] Last: You start by reading its documentation: http://www.cplusplus.com/refer... (by keskiverto)
istream operator
 
Main function code: Rational B; cout << "Enter the value for Rational B: "; cin >> B; //This is where I'm having trouble cout << "The value of B is: " ...
[2 replies] Last: Thanks! fixed code: std::istream &operator>>(std::istream &in, Rati... (by JRimmer)
by gghf
template class input operator overloading
 
Basically I have a template class that I want to be able to store data using a function I named void Push(). I want to overload the input operator >> so that I...
[4 replies] Last: can you show the relevant code ? (by nvrmnd)
Map iteration
 
Good evening, and thank you for your time, I am very junior (college level), and I seem to have problems iterating through a map that I have to use in my proj...
[14 replies] Last: Essentially, this is the difference: auto iter = set.find(s) ; if( i... (by JLBorges)
by as0re
unkown error with R/P/S
 
I am getting an unexpected error while trying to compile this R/P/S game, but MS Visual Studio does not seam to display where the error is!? Can some one help...
[2 replies] Last: In addition cout << "My choice is.\n"'' Missing semicolon ... (by eyenrique)
by sky3
Passing array into function
 
Ok so i have the counter working but the output for max and min is a long random number. can anyone give me some hints? /* Problem description: Write a pro...
[14 replies] Last: Thanks so much! I finally got it done! (by sky3)
Drivers ed program
 
I am writing a simple program that takes in the multiple choice responses of A,B,C and D as input and there are a total of twenty questions. I then compare the ...
[2 replies] Last: char users_answers for(int i = 1; i<=20; i++) Arrays start at z... (by TheIdeasMan)
operator double();
 
Input: Rational A(3,2); double x = A; Expected Output: "1.5"; Resultant Output: "1"; //operator double(); Rational::operator double(){ /...
[2 replies] Last: Thanks! Problem solved! Rational::operator double(){ //Inside th... (by JRimmer)
if then statement
 
i need help with if then statements so when i input a certain answer it outputs a certain text #include <iostream> #include <cmath> int main() { usi...
[4 replies] Last: and yes as Zhuge said there are some compile time errors that you have... (by ak16)
Overload Operator (=);
 
My question is how do I get this function to return this instead of my temporary variable? this being the variable that called the = function. So if I p...
[8 replies] Last: yes you can do directly like - *this = inputObj; But with this y... (by ak16)
Some tricky functions
 
Basically I have been assigned to translate one language to another as follows: there is an input motion that represents what should be done in what order. "/" ...
[no replies]
What's going on here?
 
Well, i've been working on this for some time for class, and haven't been able to quite see what i'm doing wrong. Can any of you more experienced programmers se...
[5 replies] Last: T should not be a char , but s should. Also, [code firstline=56]i... (by long double main)
HailstoneOdds problems.
 
Having a little trouble with my HailstoneOdds function in my Hailstone program. It gets the count correct when I run a odd number through it because the one ret...
[no replies]
HOW WOULD PUT THE OUTPUT INTO ROWS AND 4 COLUMS?
 
HOW WOULD PUT THE OUTPUT INTO ROWS AND 4 COLUMS? #include <iostream> using namespace std; using namespace std; int main() { long un...
[3 replies] Last: You are welcome! (by eyenrique)
If else error
 
in the line | if (ifelse <= 65) && (ifelse > 50); | an error of "expected and expression" appears under && and an error of "expected a statement" appears in the...
[4 replies] Last: Fantastic! Thanks for the help. It's working now. (by Hubbs66)
help with finding average
 
Ok so, I'm fairly new to C++ language and I am learning the best I can. I had an in class assignment to write a code that prompts the user for students (unknown...
[2 replies] Last: I appreciate the advice and the speedy response. I apologize for my la... (by dub1987)
Edited
 
...
[5 replies] Last: Thanks for your help! Everything works good now. (by jfinley6)
help with do while loop
 
i want to display this (1,2,1,3,1,4,1,5,1,6,1,7,1,8,1,9,1,10) using the do while loop but i'm stuck. k = 0; do { cout << ","<< k; k = k + 1;...
[10 replies] Last: thank you (by thelaitor1)
Pointers
 
I don't really understand pointers. In fact, why should they be used? I know the * means 'value pointed by ' and & means 'address of'. int x = 0; int *p_p...
[5 replies] Last: [quote=Nathan2222]@catfish: i have no idea what you mean by lambada, p... (by Catfish666)
Starting without Debugging Problem
 
I created a program last night, but when i opened it today and tried to edit it. However, no matter what i put in the code, when i go to "Start Without Debuggin...
[1 reply] : You probably have to press Build or Compile or something like that bef... (by Peter87)
February 2014 Pages: 1... 3637383940... 60
  Archived months: [jan2014] [mar2014]

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