General C++ Programming - September 2016 (Page 16)

Combining private and public inheritance
 
I have a library which provides class Base and a class Derived. I want to make a class which inherits publicly from Base (it can be used polymorphically as a Ba...
[no replies]
by ncaver
HW0
 
Implement a program in C++ that does the follolwing 1.Read as input average course score 2.Proves it to find the letter grade 3. Display the better grade ...
[3 replies] Last: cout << "The average is: " << average << endl; average is not declared... (by sylphsang)
Potentially uninitialized local pointer variable used
 
Hi. Look at this local pointer variable Node*& searchResult{ SearchPrivateRef(key,root) }; And now look at the SearchPrivateRef() function ...
[3 replies] Last: that seems useless and repetitive. You do have some misconceptions. ... (by ne555)
by kekie
User interupts program output C++
 
I have written a program that gets user input with getline(), and then prints some information to the terminal with several std::cout's, with some delay in-bet...
[4 replies] Last: Short answer for people who don't care to trawl the link (I didn't, my... (by mbozzi)
by mkb555
Reasons for crashing after program ends
 
I've had programs segfault at the very end before, and it was always solved by adding/modifying a destructor of one of my classes. However, a program I'm workin...
[1 reply] : Any undefined behavior could cause this. Check array accesses and lo... (by mbozzi)
Need help on how to set this one up
 
Hey, guys. I need help with this question: A piece of wire is to be bent in the form of a rectangle to put around a picture frame. The length of the picture fra...
[5 replies] Last: Ok. So I got this. What do you think? #include <iostream> using na... (by Leo1994)
Why is virtual inheritance so named?
 
Hi, I was wondering why virtual inheritance is so named. I expect to improve my understanding of it when I hear the reason for its name... Thanks Juan
[1 reply] : For gentleguy, if I have not answered other questions' responses is be... (by JUAN DENT)
Building a lambda expression which applies a metafiction twice...
 
Hi, I am stuck. I have this metafunction twice: template<class F, class X> struct twice : mpl::apply<F, typename mpl::apply<F,X>::type> ...
[3 replies] Last: I am afraid the meaning of lambda expression is taken differently here... (by JUAN DENT)
by mkb555
For loop with sscanf crashes after first iteration
 
For some reason, this for loop causes the program to crash RIGHT after the first iteration. No error message, no segfault, just stops working. ------- myTe...
[3 replies] Last: The file has many lines of data that follow specific, easy-to-extract ... (by mkb555)
by cmisip
Trying to understand move semantics. Please comment
 
I wrote the following test implementation trying to wrap my head around the concept of move semantics and constructors and assignments in general. I was wonder...
[5 replies] Last: Thanks a lot. This puts a lot of concepts in proper contexts for me. ... (by cmisip)
Vector subscript out of range
 
I have googled the issue and I do not see why in my program this error is being thrown. Any help would be appreciated. #include <iostream> #include <vector...
[2 replies] Last: Oh wow that was easy... I knew it was going out but I just didn't put ... (by ThisUserAgain)
Function Pointers
 
I need to convert a C program that made extensive use of function pointers for despatching tasks into a C++ program. I have looked at a variety of functor imple...
[1 reply] : C++11 has a std:function: http://www.cplusplus.com/reference/function... (by coder777)
by mkb555
sscanf gives wacky numbers
 
I need to parse a file that has very specific formats for each line, so I thought sscanf would be an easy solution. I tested it out with a single line of the fi...
[4 replies] Last: #include <iostream> #include <cmath> #include <string> #include <sstr... (by Chervil)
by FruiYk
need solution for my script
 
i think my script is pretty okay ( i know its dutch) you need to guess the number between 0 and 20 and you have 4 try's if you guessed it it wil return 0; but ...
[1 reply] : You have int main() { // code // code you want to repeat } Move ... (by keskiverto)
How to cout the negative numbers from a array
 
Hello, im new in c++ programming.I made an array with 10 numbers.Can someone tell me how to cout the negative numbers from the array.I know that i have to use i...
[9 replies] Last: If you know your array is going to hold 10 values, you can skip the 's... (by Aryan66679)
by x1ionu
Shortening a line in my script
 
I've created and edited the crap out of a script to calculate pi, and now I just want to know if I can make the line that carries out the calculation any shorte...
[6 replies] Last: Hmm... Interesting. I will try this and see what happens (for fun). ..... (by x1ionu)
by RobCh
Eigen library yaw and pitch
 
Hello, I need some help with my flight simulator, I have encountered the first problem which I know I will not be able to do myself. I need to be able to tak...
[5 replies] Last: http://www.cplusplus.com/forum/beginner/196619/ (by closed account 48T7M4Gy)
by mjgal
Doubts on class types on boost spirit x3
 
Hi, I'm relatively new to programming in modern C++ (have done some things in C using some newer C++ concepts but that's about it). I'm trying to use boost's s...
[no replies]
Cin and Cout Objects
 
/* Here is a program that uses cout and cin objects. *Its intentions is to display personal infomation of a user. *This program uses one data type "if appro...
[3 replies] Last: Thank you all,now working (by nigeljaure)
Impossible to read a file
 
HiĀ ! Because of your help i can find if a file exists. But now it is impossible to me to go on and read the file. I think all the difficulty is in the lineĀ :...
[5 replies] Last: You are realy a gentle guy. Every thing is now OK. I think I could nev... (by sylvain)
September 2016 Pages: 1... 141516171819
  Archived months: [aug2016] [oct2016]

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