Beginners - November 2016 (Page 40)

Can't access private variable
 
Solved Solution
[3 replies] Last: It's poor etiquette to remove your question after it has been answered... (by mbozzi)
getline(cin, ) stops code
 
I'm trying to get the following functions to work where it prompts the user for a string, checks whether that string is an entry in a preceding vector, and if...
[no replies]
how do i insert spaces in char Array?
 
okay so I have to write a program that accepts input from user, a sentence in which all of the words are together, but the first character of each word is upper...
[1 reply] : Please use the code-tags (the "<>" button) when posting code. Here is... (by Nico)
How to loop back if incorrect input put in
 
I am wanting to loop back to the question asking "Would you like to Play again, y/n." once a incorrect input is put in such as if h is put in instead of y/n the...
[2 replies] Last: Yes this works much better, tyvm. But with me doing this I now have a... (by MackieJ)
Question about overload operators "<<" and "+"
 
When I was overload operators "<<" and "+",I thought it would be print '13,20',but why print '20,20'? This is code: #include <iostream> using namespace st...
[2 replies] Last: Your operator+ should not change the operands, but return a new Test o... (by Arslan7041)
How does virtual destructor work in this case of derived class
 
I was reading about deriving exception class for custom exceptions. That is when I came across this issue of virtual destructor. I have not actually written vir...
[4 replies] Last: When you destroy an object, you don't only invoke the destructor of th... (by MikeyBoy)
double precision
 
I am trying to add a series of numbers of type double and there are always precision errors with double numbers. for example 2.2 is stored as 2.1999999999999976...
[3 replies] Last: For situations dealing with money, one could use integer values based ... (by Chervil)
Improper call to function
 
So I keep getting an error when I try to create an instance of my MazeReader in my main.cpp for an improper call to the function. main.cpp:8:13: error: no mat...
[1 reply] : main.cpp line 8: You instantiate MyMaze using MazeReader's default co... (by AbstractionAnon)
Don't know how to add prefixes/postfixes to objects
 
Don't know how to add prefixes/postfixes to objects in my program #include <iostream> using namespace std; class Square { private: double side; ...
[1 reply] : Lines 50-55: operator > should return a bool. Your line 52 will eval... (by AbstractionAnon)
Having trouble with code error
 
I am working on a project for a class and my code is getting the error. If somebody could help fix my code that would be awesome. The thing we are trying to ...
[3 replies] Last: I've retained the intended program logic unchanged, but made some modi... (by JLBorges)
Is it possible to input pi?
 
I have written a piece of code to solve a differential equation using Euler's method. The code allows the user to input where they would like the solution to ap...
[1 reply] : No, there is no built-in way to allow expression like that. You'll hav... (by Peter87)
Pointer Program Help (Completely Lost)
 
So, I could really use some help, and an explanation here. I had a lot of trouble with my Pointers test and am trying to understand what to do with this assignm...
[8 replies] Last: Perhaps you need to dereference with *pScore and *pYear? (by koothkeeper)
by fluppe
problems with a string ...
 
I have a basic problem concerning strings and such. I don't know what is a possible reason for the following: I want to have string concatenanted and then i sen...
[8 replies] Last: Cool, that sounds easy. I'll do that immediately. Thank you very much... (by fluppe)
by Hengry
Help with classes and object
 
My question would be the output statements for my TaskList.cpp. For outputFromList() I want to output the Task(s) the user has input into the vector and for...
[3 replies] Last: You're welcome. Why would I need to pass-by-reference and not just ... (by gunnerfunner)
segmentation fault
 
i have my code all done but when i try to run it there is a segmentation fault right after i have someone input a year. i dont know why #include <iostream>...
[3 replies] Last: while (in_stream >> mnames >> fnames && i++ < size) This is going ... (by lastchance)
Help with Error 'cannot bind'
 
I keep getting this error: cannot bind 'std::ostream {aka std::basic_ostream<char>}' lvalue to 'std::basic_ostream<char>&&' #include <iostream> using na...
[4 replies] Last: I guess this is what you are asking for: #include <iostream> using na... (by lastchance)
Adding real numbers
 
Ok hi guys, just started electrical engineering a few days ago, and c++ programming is a part of the degree, and i need some help with it lol i made a code, ...
[4 replies] Last: thank ye so much :) worked (by ofiryak1994)
issue with an else statement
 
Here is the problem: Here is the problem text: You have invented a vending machine capable of deep frying twinkies. Write a program to simulate the vending mach...
[2 replies] Last: Many Thanks! (by ruslive109)
iterating through an array for condition statement?
 
Is it possible to make is a condition which iterated through an array? For example you don't want a user to store duplicate numbers into an array so you have an...
[1 reply] : If you are trying to decide whether or not to accept an incoming numbe... (by gunnerfunner)
need help with tower of hanoi logic
 
I'm working on making a program that can solve a tower of hanoi with a given number of rings on it. My logic is faulty and the program eventually falls into an ...
[2 replies] Last: It's the series of if statements in the solve function, which I based ... (by heckorb)
November 2016 Pages: 1... 3839404142... 44
  Archived months: [oct2016] [dec2016]

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