General C++ Programming - December 2018 (Page 3)

Issue with making single argument constructor as explicit
 
Hi, As per the cpp guidelines mentioned in : https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rc-explicit the single argument constructors should b...
[3 replies] Last: explicit string(string); A class cannot have a single-parameter cons... (by Peter87)
best book for C, C++ and Java programs?
 
What is the single best book for C, C++ and Java programs?
[3 replies] Last: Could be. In which case the answer is the same; there is no "single b... (by Repeater)
by Grime
Mapping matrix with index values (IMPROVEMENT)
 
This is not homework. I have already solved the problem. But I want help to see whether there can be a better way to do this. Given M and N the height and wi...
[5 replies] Last: > matrix( int height, int width ) : nrows(height), ncols(width) > What... (by JLBorges)
Question about Bjarne's book PP&P using C++
 
Hi. In chapter 6 of the book, page 240 it says: "This second version of the calcula- tor program (including Token_stream) is available as file calculator...
[no replies]
Adding empty destructor generates seg fault.
 
The following code compiles but generates a segfault at runtime. If I remove the empty destructor or the last statement in main, the code runs without problem. ...
[6 replies] Last: @JLBorges: Thanks for the detailed code. I must admit I had to do so... (by CABrouwers)
Maze with exact moves available to finish
 
Hi, I'd like to ask for help. I neeed to print maze made of '.' and '#' where '#' is wall and '.' is just place I can move at. Maze has to be generated with ex...
[2 replies] Last: there's supposed to be variable columns instead of n, im sorry for tha... (by schobelix)
by Grime
Fast C++ compilers?
 
I use visual studio 2017 but I also want to use a more lightweight compiler. Any suggestions?
[6 replies] Last: I will say this: your IDE does not matter, because its just a text edi... (by jonnin)
devcon.exe information to save in file
 
Hi, I need to create "temp.dat" with information devcon.exe, but doesn't work. Source code below, could you help me? // #include "stdafx.h" #include ...
[2 replies] Last: You need to specify that you're redirecting to a file in the STARTUPI... (by Ganado)
Extra qualification error - C++
 
void ADDRESS_BOOK :: operator<< (ostream& f); extra qualification 'ADDRESS_BOOK::' on member 'operator<<' [-fpermissive] how can I solve this error?...
[1 reply] : Remove ADDRESS_BOOK:: on that line. (by Repeater)
Need help in implementing move constructor for my string class.
 
Hi, I am implementing my string class and stuck with an issue in defining move constructor. class Str { private: char* c_str_; public: Str(); ...
[9 replies] Last: Thanks @JLBorges for the library implementation link. Thanks @MikeyBo... (by kapil2905)
Change Console background to a colour
 
I want to be able to change the entire default console background to the colour green. Many people have posted examples but when I use: int main() { SetCons...
[7 replies] Last: https://stackoverflow.com/questions/19913446/why-should-the-system-fun... (by Ganado)
by Grime
How to reserve memory for 2D vectors?
 
I'm working on a problem I saw online to take information about jigsaw puzzle pieces and display the solution in matrix format. Basically the four sides of the...
[11 replies] Last: if (!exists) break; // no puzzle match the right part so break ... (by Enoizat)
What are the errors in this c++ code?
 
I am having trouble finding any errors in this code in Visual Studio. Can you help me to find them and correct them? It would be very much appreciated. Here is ...
[1 reply] : here you are || foo.cpp: In function ‘int main()’: foo.cpp|39 col... (by ne555)
10x10 array homework pls help me
 
hey, I'm studying genetics and bioengineering. ı need help with a homework. Define a 10x10 matrix using encoding. then randomly place numbers from 1 to 100. Ch...
[1 reply] : not sure what you mean with encoding the other instructions are also k... (by ne555)
How can i sort binary search tree by count
 
Hi everyone, i have a binary search tree. it has string name and int count also it has left and right Aahan 25 Aalam 87 Abharan 21 Abhinandana 998 Kumari 24 ...
[1 reply] : Make sure that your binary tree's node struct has data members name... (by lastchance)
Help a random student
 
I need help in creating a programme I just need guidance as im pretty bad at C++ This programme is about creating a membership management system which offers 10...
[2 replies] Last: Start simple. Define a class for a member. Create methods to read a m... (by dhayden)
text file: how delete a character?
 
i have a text file fstream. i did: file<<"\t"; now imagine that i need delete 1 tab... how can i do it?
[15 replies] Last: I quote. the only valid values for the position to seek to are zero ... (by salem c)
Help with creating function, GetLastTimeFileModified
 
Can someone help me solve my problem. I need to create a function that checks a file and returns the date that the file has last been modified. I've found t...
[5 replies] Last: > How do I convert it to my System time and not utc? SystemTimeToTz... (by JLBorges)
Why post increment is always implemented in terms of pre increment.
 
Hi ppl :), I was checking on overloading pre and post increment operators for a class and I could see almost in every example, post increment is implemented ...
[3 replies] Last: 2) Is there any guideline to implement post increment in terms of pre... (by Cubbi)
by a00
streamstring useage
 
I wrote a program This is my code: #include <iostream> #include <string> #include <sstream> using namespace std; int main(){ int n; cin >> n; int *data = ...
[2 replies] Last: Thanks lastchance. After read your answer: I play around with the code... (by a00)
December 2018 Pages: 12345... 10
  Archived months: [nov2018] [jan2019]

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