Beginners - September 2013 (Page 10)

Const correctness and mutable
 
I've been reading up on const and mutable keywords, and I have come up with a use case in my project where using both could apply. So I would like to hear peopl...
[4 replies] Last: bits is not part of Test1's state because Test1 is merely a container... (by cire)
by ihnena
How to put all cout statements together when using if/else if
 
Hello! I'm very new to C++, I've only been learning for about a month. I posted this question earlier, but I made it very wordy and probably hard to understand....
[3 replies] Last: I feel kinda silly now haha :v (by xismn)
Pseudocode
 
To write a program as a pseudo-code do I just write down in a word document as Prompt and read? Just got confused.
[6 replies] Last: Thanks all (by evan1991)
by leo255
Need to end program if condition is not met
 
Hi everyone, Pretty simple question here - I just want to end the program if the user doesn't meet a certain condition...I think I heard "return 0" when I read...
[5 replies] Last: I'm not sure what you are asking. The program will always end when it ... (by Chervil)
Functions
 
I have a function called diceRoll() and it itself is working great, but the problem I'm running into is when I try and record the value returned by that functio...
[1 reply] : Well, each time you type out: diceroll() you are calling the funct... (by Ispil)
string subscript is out of range
 
Alright guys you can see what needs to be done for my assignment in the comment. When i run the program it crashes and tells me "string subscript is out of rang...
[1 reply] : You're attempting to use a std::string as though it was a c-string. I ... (by Chervil)
Initilization List + Inheritance Assistance/Help
 
#ifndef ACCOUNT_H #define ACCOUNT_H class Account { private: double accountBalance; public: Account( double initialBalance = 0.0); bool bCredit( do...
[3 replies] Last: ^Thanks for the tip! that solved a good portion of the problems but I'... (by CodeMonkey05)
by ihnena
How to format cout statements when using if... and else if...
 
Hello! I'm just starting to learn C++, so I'm not quite sure what I'm doing yet. For this program, I have to write a program that will calculate how much a per...
[2 replies] Last: Oh oops, sorry. There you go! (by ihnena)
Polymorphism. adding new functions
 
I have a base class Building. All its functions are virtual. Then I have a derived class named Residential Buildings. It overrides all virtual functions and has...
[3 replies] Last: Hi there, Let's look at your code: void main() { Residential_Bui... (by closed account o3hC5Di1)
by patieB
char and string output
 
I have written the code for the question below, but i am not satisfied with it . 1 , its just picking the first letter and cuts the rest and its also not me the...
[3 replies] Last: Okay i think the logic of that code you pointed out is the which is of... (by patieB)
Increment and decrement operators in postfix and prefix mode
 
I am using Microsoft Visual Studios 2010, and when In input the code: #include <iostream> using namespace std; int main() { int a = 5, b = 5, c =...
[4 replies] Last: Thanks again. Thanks, -jumpinmp (by jumpinmp)
Initial Integer won't output after cmath coding.
 
Hi all. I'm having a problem with my output displaying the correct integer. User is prompted to enter 2 integers. Part of the code determines evens and odds and...
[8 replies] Last: Good call. Give my brain and eyes a rest. (by CFalkirk)
Algorithm to determine multiples? W/o need for libs or extra includes.
 
Consider the following code. #include <iostream> using std::cin; using std::cout; int main() { for(int i = 0; i <= 100000; i++) { cout << "...
[2 replies] Last: Great answer, I was expecting the Modulus to come into play first as i... (by closed account G30oGNh0)
Stack and the heap
 
The stack holds all of the memory that is being used. The heap has access to memory that isn't being used. Am I correct?
[2 replies] Last: Thanks! (by MasterT)
Populating multiple variables with one cin
 
Hi, I'm in the 4th week as a new student in C++ at Central New Mexico Community College. We were shown a code snippet yesterday that the teacher was unable to e...
[4 replies] Last: Yes, I think that's a fair way of looking at it. You might say, if all... (by Chervil)
Substrings
 
I am learning sub-string find and replace. I have written a program that does other things besides that, however the part I need help with is to have a user en...
[1 reply] : Hi there, First off, I'm not sure if your aware, but some of these fu... (by closed account o3hC5Di1)
Request for help with problem involving Strings, Substrings, Delimiters
 
Hello all. I'm new to the language and trying to finish off a lab problem. We are expected to prompt a five word, spaceless input divided by hashes to read to a...
[4 replies] Last: The program does now work after adding pos = totalF.find(delimiter); ... (by steviethundr)
by saiz
value of friday
 
what is the value of friday in this case? enum days { Monday,Tuesday,Wednesday = -1,Thursday,Friday,Saturday = 6 } Thanks
[1 reply] : The fact that you are not willing to simply compile this is completely... (by Computergeek01)
how would I use set fill to repeat a string. like "%_"
 
how would I use set fill to repeat a string. like "%_" cout << setfill ('%_') << setw (35); my IDE is complaining about the above line of code. ...
[1 reply] : Hi there, could you be a little bit more specific as to what your IDE... (by closed account o3hC5Di1)
Variable "--" being used without being initialized
 
Hey, I am taking a introduction to Computer Science and I am having difficult in finding a solution. So I keep getting the error "Variable integer being used wi...
[11 replies] Last: Thank you so much NwN i spent a few hours trying to figure out what th... (by canucksfan1)
September 2013 Pages: 1... 89101112... 64
  Archived months: [aug2013] [oct2013]

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