General C++ Programming - April 2018

Move constructors not getting called
 
ey guys,to my surprise it seems like the move constructors are not being called when I set an object = to an rvalue object, this took me by surprise,the object...
[5 replies] Last: My 2 cents worth :+) string* name; // ... name = new string(nme); ... (by TheIdeasMan)
Need help !
 
Hello ! Im a not so good with files, especially with Direct Access Files. So i need your help. I want sort structure in alphabetical order using Selection Sort...
[11 replies] Last: This is where a vector would come in handy. I dont know how to use ... (by Nikoleschi)
by WildB
Need help with inheritance
 
This is the Assignment: Given the following declaration for a TestScore class, write a derived class declaration called IDScore that adds an integer student ID...
[no replies]
Issue with program.
 
*topic solved.
[3 replies] Last: Don't delete your post after being helped. Leave it as a reference for... (by Ganado)
Class and Objects//Files And Fstream
 
Anyone knows how to make funcqtion, wich reads from file any line as a string, than it splits up this string, and with Set() function we put it in class
[7 replies] Last: @andriass Ugh, where to begin... your code actually isn't even legal C... (by Ganado)
What is faster?
 
Lets say I have 2 separate functions which do the same thing: simply initialize a 2d array. Function 1 does it with a straight forward nested for loop. IE ...
[3 replies] Last: Function 2 won't work. (by lastchance)
by ahaana
plz help the inserted data doesnt display
 
#include <iostream> #include<string> using namespace std; struct Winter { string subject ; }; struct Summer { string subject ; Winter win; ...
[1 reply] : Isn't this just a duplicate of http://www.cplusplus.com/forum/general/... (by MikeyBoy)
C++: exception thrown during debugging of code on VS2015
 
Hello fellow C++ coders, I have some code that builds but during debugging with local windows debugger (going down line by line) I get this error that aborts th...
[4 replies] Last: how does that help solve the problem It tells you that an index of 2... (by MikeyBoy)
failed to run html help compiler on index.hhp
 
https://imgur.com/l4PRnwG
[no replies]
stock algorithm: double top
 
i am currently working on an algorithm for my final project, part of it includes finding if the vector of objects that was imputed from a stock csv file. I was ...
[2 replies] Last: It is not quite clear what you are doing / should do. Does the order ... (by keskiverto)
Move semantics
 
Hi guys there seems to be a debate on stackoberflow on why you should leave a rvalues data members in a certain state even thought you will never use it again ...
[2 replies] Last: good point because they will both point to the same data thanks :) (by adam2016)
by ahaana
after inserting the data is not being displayed
 
#include <iostream> #include<string> using namespace std; struct TTcell { string days ={"Mon","Tue","Wed","Thur","Fri"}; string Subject ; ...
[no replies]
by ahaana
getting error could not convert '5074798' from 'int' to 'std::__cxx11::string {aka std::__cxx11::basic_string<char>}'|
 
#include <iostream> #include<string> using namespace std; struct TTcell { string days ={'Mon','Tue','Wed','Thur','Fri'}; string Subject ; ...
[3 replies] Last: I think the array size needs to be explicitly specified for members of... (by Peter87)
Help in Doing Certain Tasks
 
How can I make this so that the enemies disappear when we attack? In addition, the main character seems to be insta-dying :\ #include <iostream> #include <std...
[no replies]
‘{‘ missing function header
 
I get this error on line 22. What do I do? #include<iostream> #include <windows.h> using namespace std; int Map = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[3 replies] Last: got it, ty (by rororoxor)
C++ error:String input wrongly goes into if conditional statement even when string input is correct
 
Hello everyone,I have a simple function in C++ where I ask the user to select if they female or male by typing in the appropriate string ("FEMALE" or "MALE") in...
[2 replies] Last: @tpb-thanks for the helpful reply. I will try it out. (by MBANS7A1)
'writeColor': is not a member of 'Circle'
 
I'm getting the following error: 'writeColor': is not a member of 'Circle' From the following code (pdf's on google drive): Header code: https://drive.google...
[1 reply] : You really should post the code here. Make sure you put it in code tag... (by tpb)
by Heymid
Choosing regular arithmetic operation as function of boolean
 
Is it possible to make something like this: #include <iostream> using namespace std; int main(void) { int (*z ) (int) = {&(operator-), &(operat...
[3 replies] Last: Well, you should still put the <functional> in there for portability. ... (by Ganado)
enumerator inside class type
 
I'm having a problem with a function telling me that my enumerator type Color is undefined, even though I have it defined inside the public section of a class. ...
[2 replies] Last: That was it. Thank you very much! (by closed account o1pz6Up4)
Cannot convert negative values - threaded
 
Hi all, I am working on a threaded code for numerical computations. I am getting from time to time the message "Cannot convert negative values" and my progr...
[2 replies] Last: Thanks Peter. I had not heard of "data race" before. I'll look into i... (by bernt0cpp)
April 2018 Pages: 123... 17
  Archived months: [mar2018] [may2018]

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