Beginners - April 2019 (Page 22)

by Bopaki
Program bombs out after I ever the value for x
The header file & Implementation is exactly as it is the textBook The exercise is only to write the main program to test copy constructor. class pointe...
Apr 4, 2019 at 1:18pm
[9 replies] Last: Thank you all good people. The introduction of the little 3 character ... (by Bopaki)
Can't seem to understand why my Insert function isn't working correctly.
Hello, I've been trying to recreate a Morse Code Binary Search tree like in this image, https://imgur.com/a/ByxW6hh. But I can't seem to understand why my Inse...
Apr 4, 2019 at 9:19am
[1 reply] : No C++ necessary, Pipelines is all you need: pipe diskr morse.txt!sor... (by MikeStgt)
Function about Vowel Removal Error
So I was writing a function to remove all the vowels in a string, and I kept getting this error: pa07.cpp:138:39: error: non-const lvalue reference to type '...
Apr 4, 2019 at 9:01am
[2 replies] Last: You are not the first one, see here: http://www.cplusplus.com/forum/be... (by MikeStgt)
by Halken
Convert from Arabic to Roman Numerals
I am trying to convert Arabic to Roman Numerals (with the intention to later do the opposite using the same code), however, the test cases are not outputting th...
Apr 4, 2019 at 8:54am
[1 reply] : Look here: http://www.cplusplus.com/forum/general/250894/#msg1104938 I... (by MikeStgt)
Constant Objects
I have a couple fraction objects that are declared as constant and they go through a multiplied function and get multiplied correctly. Then the answer goes thro...
Apr 4, 2019 at 8:22am
[4 replies] Last: That makes sense. That was actually how I was trying to do that in the... (by stoneJax)
Sending terminal output to text file
I have to do an assignment where I make a diamond in C++ with asterisks and output the result to the terminal and a .txt file. The diamond shows up fine when I ...
Apr 4, 2019 at 4:39am
[1 reply] : You need to execute both cout << ... and output << ... within ... (by JLBorges)
Improving my overload constructor's number of arguments
I want to create a game that runs in the command prompt. Not sure if it'll be only text based or will have basic ASCII art yet. But anyways, I'm setting up the ...
Apr 4, 2019 at 4:29am
[3 replies] Last: > What's this part of the code do..? It initialises the two members ... (by JLBorges)
Move the indicated code into functions
Im not sure what Im doing wrong. How would I fix my code? Original code // Move the indicated code into functions. #include <iostream> using namespace std...
Apr 4, 2019 at 3:00am
[2 replies] Last: @AbstractionAnon thanks (by dbarclay100)
Creating a code using classes to keep track of a company's day to day business
I am trying to modify the code to keep track of day to day operations of a made up medium sized company. I want the name to be Minion World. class Task ...
Apr 3, 2019 at 11:40pm
[4 replies] Last: Another tutorial on classes and object-oriented programming: https://w... (by deleted account xyzzy)
Help with a function
So I need to write a function that is described like this: std::string capitalize(const std::string& str); /// Returns a copy of the string centered in a ...
Apr 3, 2019 at 11:22pm
[3 replies] Last: Thanks both of you, I was having such a hard time, but I'm good now. (by closed account 9hX8C542)
sum of k adjacent elements in array
Hi to all. This is my first topic. My problem is this: when I run the code posted, the value of MAX at the end of "for" cicle is right, but when I write it ...
Apr 3, 2019 at 9:32pm
[6 replies] Last: I think you need to swap your current lines 18 and 20. What you do wit... (by lastchance)
by sturk
C++ Polymorphism
Could anyone tell me why is the output for the code below "Derived::foo()" and not "Base::foo()"? Revising for an exam. Thanks class Base { public: vi...
Apr 3, 2019 at 6:23pm
[1 reply] : Here is a runnable version of your code. (Please don't use void main()... (by lastchance)
How do I instantiate a templated doubly linked list with strings?
I'm trying to create a doubly linked list filled with strings. It works with chars and ints but when I create a DLL of type std::string, it compiles with a blac...
Apr 3, 2019 at 5:58pm
[4 replies] Last: Alright. I removed all NULL comparisons and made them 0. I am runnin... (by aimh4wk)
by wuwy
How to stop program sequence if it reaches its target
Hello. I need help with this exercise, been trying to figure it out for the last 2 hours and this last bit specifically is what I keep failing at. Gist of th...
Apr 3, 2019 at 2:08pm
[1 reply] : one way you can stop by adding more conditions to your for loops. eg ... (by jonnin)
Setting one key to 15 different numbers
Hi, I have to create a program with a Bingo board that can cross out numbers as you read them in from a text file. The only difference between my project and t...
Apr 3, 2019 at 1:43pm
[4 replies] Last: This should work with C++11: It does. (by MikeStgt)
Primary Expression Error (Help?)
I keep getting an "expected primary-expression before '.' token" on lines 6 and 12. Does anyone know what's wrong? Thanks. I am using SFML and a sprite to make ...
Apr 3, 2019 at 2:05am
[1 reply] : You wrote Event but meant event on both lines 6 and 12.... (by mbozzi)
Unhandled exception
#include <iostream> #include <string> #include <fstream> using namespace std; struct cmt { string no, hour, min, gender, age, job, subject, conten...
Apr 3, 2019 at 1:19am
[8 replies] Last: I've tried to converted the numbers into integers, but all I get was: ... (by thinhphucvang)
Help with methods and pointers GROSSPAY
I am having trouble getting my calcGross Method. I can't get it to multiply a int* by a double* to go into a double. I am also getting an error on line 9 at the...
Apr 2, 2019 at 10:35pm
[7 replies] Last: Thank you for the help it's running now! (by Flynn Rhodes)
Queues implementation
1. Create a PriorityQueue class and implement a new enqueue ) method to implement a priority queuing discipline. For efficiency, priority queues are often imple...
Apr 2, 2019 at 8:50pm
[1 reply] : #include <iostream> #include <cctype> #include <limits> int main() {... (by deleted account xyzzy)
by Jclow
While within while just hanging?
Hi Guys, I'm trying to extract data from an XML file. I have multiple groups of data, with each group being between a PrimaryMarkerStart, and PrimaryMarkerE...
Apr 2, 2019 at 7:54pm
[7 replies] Last: Thank you Peter, I'm kicking myself for not spotting that, it works p... (by Jclow)
April 2019 Pages: 1... 2021222324
  Archived months: [mar2019] [may2019]

This is an archived page. To post a new message, go to the current page.
Registered users can post in this forum.