Beginners - April 2018 (Page 14)

Game with Stages
 
Hi I'm a beginner of c++, I would like to ask how to make a class of stages that has easy medium hard, and each stages there has a level 1- 10 and each level ha...
[3 replies] Last: I'm afraid you need to hard code all those values somewhere, preferabl... (by Enoizat)
Need help understanding set-get and classes...
 
So our professor told us to do the following: Modify the Date.h and Date.cpp to include four more member functions setDate(), getDate(), setMonth(), getMonth...
[1 reply] : Class basics: http://www.cplusplus.com/doc/tutorial/classes/ http://ww... (by closed account E0p9LyTq)
Weird do-while loop error
 
I am doing a Pythagorean triples program where it detects how many triples there are based on the upper limit that's inputted. So, when I first execute the loop...
[2 replies] Last: Thank you I got it. Alignment is still pretty new to me. Should try to... (by AParendkar)
Complex solutions of a cubic equation
 
I was asked by my professor to code a program which solves the roots of a cubic equation following the discriminant approach found here: https://www.wikihow.com...
[4 replies] Last: Thanks guys, very helpful! (by EmilianoG)
by Menase
Passing Streams Into functions
 
I was trying to make a function that parses an object from a stream and append it to a list it always ends up creating a segmentation fault. //The usual vo...
[5 replies] Last: How many items are in the students collection before line 6 runs? If ... (by dhayden)
Need Help with Dynamically Allocated and Pointer
 
One of the practice problem my prof gave me is to change the the Vehicle class so that all the data members are pointer which are Dynamically allocated such tha...
[3 replies] Last: Thanks For the help but i have since went to see my prof and he was ab... (by SkyWalker1O1)
reading Roman numerals - logic error
 
Hello, I'm currently going through Programming Principles and Practice Using C++. At the moment of writing, I'm trying to write a program, that converts Roman ...
[4 replies] Last: If nothing else, there is a problem with the error detection. I'd sta... (by grumblesnake)
help Where is the mistake
 
// This program demonstrates a compile error. // Lihong Feng #include <iostream> using namespace std; int main() { int number; float total; cout << "Tod...
[1 reply] : The comnpiler will tell you about compiler errors. https://ideone.com... (by Repeater)
multithreading error ?
 
heya, uhh.. I think it happens while I am trying to push back item into the vector... (also this is one of my first few times trying out multithreading so I'm s...
[4 replies] Last: The second operand to % is not allowed to be zero (just like with /... (by Peter87)
Vector of double pointers
 
Hi, I would like to use push_back in order to fill up a vector, containing double pointers. However, when I delete the pointers after pushing them back into the...
[1 reply] : If you delete the array the pointer that you just inserted will get in... (by Peter87)
Using Default and Second Constructs to Print an Info Log
 
Hello, Below is the code I have created in attempts to fulfill the below prompt, but I cannot get this program to run. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
[1 reply] : Constructors need to be named the same as the class. When defining fu... (by Peter87)
classes
 
I know nothing about classes other then what I read in my shitty text book. I am trying to get this program to work, but I keep getting this error "no matching ...
[7 replies] Last: Ok I think I have it figured out more. The default just sets the param... (by link45jeff)
Array Problem
 
Hi, I was wondering if anyone could help me? I'm having trouble with using a function to square values of an array. When I call the function, all I'm getting i...
[3 replies] Last: replace those two loops with this: //Loop generating voltages every... (by closed account SECMoG1T)
Need some help to total these numbers:
 
#include <iostream> using namespace std; int main() {// start int x = 1, xx = 0; while( x!=0) { cout<<"enter a number to add up"<<endl; while( x!=0) cin...
[1 reply] : int x=1,xx=0; while( x!=0) { cout<<"enter a number to add, zero to e... (by SamuelAdams)
classes objects new array or vector for student objects
 
this is the copy&paste of the hw question for reference, no i do not want you to answer that. MY question is at the bottom of the thread Class name is Student...
[1 reply] : ima switch it to vectors (by r6racer)
[Solved] How to construct and initialize an array in place ?
 
Hi, Is it possible to construct an array in place as a value argument for unordered_map? I've tried a lot of things, including: std::unordered_map<s...
[6 replies] Last: Thank you for testing this out. Now it works, maybe Qt was playing tri... (by Unspoken)
Struggling with finishing this assignment
 
Im getting 3 c4716 errors in my code and I don't know what to do #include "stdafx.h" #include <iostream> using namespace std; // Global variable int...
[2 replies] Last: May I say it looks pretty obvious? int& EnterLimit(); int PrintMenu... (by Enoizat)
Eight Queens
 
For this program, I have to determine if the given configuration has exactly one queen in each row and one in each column. If it does, the program outputs "Yes"...
[3 replies] Last: I think you're trying to use a 1D array to simulate a 2D config of que... (by icy1)
Help with string
 
Im having trouble with string and having a hard time starting this. I need to write a program that reads in a line of text and replaces all four-letter word...
[1 reply] : write a program that reads in a line of text I think at least you co... (by Enoizat)
C++Project
 
Modify the Trivia Challenge program to allow for multiple players. You should create a Player class with the following members: void SetNumber(int number) - se...
[2 replies] Last: The finished solution(didn't follow the instructions exactly): Player... (by rjphares)
April 2018 Pages: 1... 1213141516... 25
  Archived months: [mar2018] [may2018]

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