Beginners - June 2013 (Page 4)

Find Lowest Score & Average
 
I'm close to successfully compiling a program for my Intro to Programming class. At this point I could use all the help out there. Well I'm down to one error....
[2 replies] Last: Thanks for the reply, I'll try that! (by stephen1101)
Why use contructor init lists?
 
What is the benefit of using constructor initialization lists as opposed to initializing variables in the body of the constructor. I often find the lists confus...
[5 replies] Last: Consider this: #include <iostream> int creation_index = 0; struct i... (by Lowest0ne)
program not returning proper values
 
Hello, I can't seem to figure out why my program isnt working. It keeps returning 0 kilograms and 0 grams. I know my function is being called properly because...
[8 replies] Last: Also, using doubles in a for loop is bad news, use ints and convert th... (by TheIdeasMan)
Making a poisoned code
 
Ok so my goal is to make a game. This code im wanting says if the player attacks, and the monster is a spider, he has a chance to get poisoned and the rest of t...
[5 replies] Last: ok sorry guys I didn't know there was a difference between C++ and DML... (by hinotai)
Time Passed Between Dates
 
Does anyone have any feedback on how I could improve this program in making it faster or/and shorter? Its functionality is this basically; you enter two dates a...
[3 replies] Last: Anyone? (by GoranGaming)
method problem
 
Soo... the code in brackets working but other #include <iostream> using namespace std; class Point{ int x_; int y_; public: ...
[3 replies] Last: ^^ really thank you :) this->x_=p1.x_+p2.x_; this->y_=p1.y_+p2.y_; ... (by purpleNoise)
Issue with ofstream
 
I'm having some difficulty getting my program to write into a file using ofstream. I checked my code but I can't find the error. Everything runs to completion ...
[9 replies] Last: Thank you everyone for all your help! It turns out that the issue wa... (by aguycalledjoe)
Problem
 
Whenever I don't understand how to solve a C++-assignment from a book or from somewhere else, I just try to understand the solution and then I memorize it. Do y...
[6 replies] Last: In that case, you need to try and break down your task into smaller, s... (by MikeyBoy)
if statement always evaluated to true
 
Hi, I was doing some work on my game, and rewriting it to avoid repetition of code, and have come across a problem I don't understand. On the main code, I have ...
[10 replies] Last: After about 4 hours of searching, I finally found what the problem was... (by manudude03)
Remainder Command
 
Is there a command to completely remove the remainder of a double variable type? I want as an example 12.96 to become 12, but it should be a general solution ...
[3 replies] Last: Don't worry, I found something that worked, the floor function :) (by GoranGaming)
vector multiplication
 
Hello, I have a vector that is filled with N values, now I need to multiply this vector with itself. Can anyone help? #include <iostream> #inc...
[1 reply] : This would do... for(std::size_t i=0;i<myvector.size();i++) { ... (by a k n)
Operator conversion
 
Hi :) If I have class String and I use operator conversion to 'print' an object with cout,why do i get no warning ? Isn't that ambiguous : String::oper...
[5 replies] Last: operator<< for char* is a nonmember operator: http://en.cppreference.c... (by Cubbi)
How do i do this?
 
Ok so sorry but im a COMPLETE beginner and the most experience have in coding is from a tutorial that GAVE the codes to me. It helped but theres one thing I wa...
[1 reply] : Well, in order to get the change part right you would need to look int... (by Script Coder)
by Pojky
Looking for some help opening the door
 
I am looking to learn c++ for the purpose of video game development. I have a entry level understanding of HTML/HTML5 CSS3 and JavaScript. I am currently us...
[2 replies] Last: http://www.cprogramming.com/c++book/ ive been going through this e-bo... (by Paoletti301)
printing numbers from an array
 
Im a bit confussed on how to print the numbers from inside my array. I know i have to use a for loop but when i run this some weird numbers pop up. float ...
[3 replies] Last: Thanks guys made it clear what i was doing wrong! T (by mauri11)
by Nyxe
Base10 to Base2 String conversion.
 
Greetings. This is my first official post on the C++ Forums. I have very little experience with the C++ language - but I've been sitting on an idea for a progra...
[10 replies] Last: Would it be possible for you to comment and explain each part so I ca... (by Catfish4)
Please tell me of these are nested loops??????
 
Is this a nested loop??? The code does what I want it to do. //#include <stdafx.h> #include <iostream> #include <iomanip> #include <cmath> using name...
[1 reply] : Yes it is, but might i make a suggestion? for ( C blah blah blah ) {... (by Paoletti301)
Confusion with this calculation.
 
I'm fairly new to this and have been going through the tutorial. However I've come across something that genuinely confuses me: a = (b = 10, b+= 10, b++); ...
[4 replies] Last: It's mostly a syntactic shortcut, if anything. You can always do the s... (by LB)
Countdown & timer?
 
Hello! I am currently trying to make a little game. Basically, it picks a number say between 1 and 10, and you have to guess it. I want to give the use...
[3 replies] Last: @tntxtnt Wow, that's awesome. Thanks! I made a version myself withou... (by TrulyRazor)
comparing arrays through class
 
I'm comparing my arrays, but when I compile it, the class member array does not show the values I copied into the array from my original array in main, but the...
[2 replies] Last: Get rid of test2 on line 58. Change line 86 to test1.grade(answer);... (by cire)
June 2013 Pages: 123456... 49
  Archived months: [may2013] [jul2013]

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