Beginners - August 2022

Linked list of structures
 
Hello! in C we define node : struct Node { int data; struct Node* next; }; Does ne...
[9 replies] Last: it is not mean that next pointer also point to the data? C++ allows ... (by mbozzi)
Floating-point comparison for mortals
 
I see a menacing dark cloud looming on the horizon and I wonder why other beginners aren't as concer...
[9 replies] Last: #include <iostream> #include <limits> #include <iomanip> #include <cm... (by JLBorges)
Problem with delete function.
 
So our prof tasked us to delete a block of array. Technically in this case, to delete GroceryList_f...
[7 replies] Last: Your assignment operator doesn't assign . You probably should remove... (by kbw)
by Geckoo
override specifier
 
Hello. In the next code, must be written the keyword override in the derived classes or not? It se...
[8 replies] Last: Re. virtual destructor When a base class is intended for polymorphic ... (by JLBorges)
I have a lot of problems.
 
So basically, our professor told us to do: Problem 1: Create a class for the fruits and the vegetab...
[8 replies] Last: "Create a class of vegetables ..." It's been a long day: I just misre... (by lastchance)
Why is this not working?
 
I don't know why my code doesn't work and my reference code works. I am trying to copy this c...
[6 replies] Last: Don't use string.h for the include - it's string. Hey! Did not see t... (by Geckoo)
by colt
Destructor causes memory exception
 
Hello. In the program I am creating, I created a destructor in a certain class, one that calls delet...
[12 replies] Last: An important question is whether you have "legacy" code that does not... (by seeplus)
static inside a class, inside a method
 
If I call a method in a class a million times but I don't want it to create and delete the variable ...
[19 replies] Last: At the end pop off the function and the static still stays on. But w... (by Peter87)
copy constructor and initialization (1,2)
 
Greetings! I don't understand why the copy constructor does not work for initializing an object wit...
[29 replies] Last: An issue with copy assignment is that you'll probably also then need a... (by seeplus)
Need a help slicing 2D vector
 
Hello everyone, I need a help slicing a 2D vector. I guess it is easy but since I am complete begin...
[4 replies] Last: std::slice doesn't work on a vector, only on a valarray: https://en.cp... (by George P)
' ' is not a member of 'std'
 
I don't know how to fix this error error : 'answer' is not a member of 'std' #include <iostream> ...
[14 replies] Last: Monument Valley is ethereal - quiet delivering good vibes. One of its ... (by Geckoo)
by Geckoo
Another Guess My World
 
Hello. I continue to increase my understanding of the OOP principle using C++. I made another game -...
[14 replies] Last: But it seems to me that I did that before... True, but if your progra... (by kbw)
by NowIC
VS Code and multiple files (libraries)
 
Hello. I setup VS Code to work with gcc and gdb (Windows 11 with mingw64). The compile and debug wit...
[no replies]
How to update Eigen matrices correctly in a solver?
 
I have an iterative solver where it solves a PDE by given an initial guess and updating it until a c...
[14 replies] Last: @TheIdeasMan I discovered what a PDE is Partial Differential Equation... (by JamieAl)
Current Usage of Copy and Move Constructors
 
I was following a course from Udemy. But I lost my interest in the c++ language 3 months ago because...
[5 replies] Last: It's hard for me to learn them and probably because of the instructor... (by George P)
How to return multiple data from a function
 
Hello fellows, In a function , I do some mathematical and obtain a vector , a double value and one...
[7 replies] Last: #include <vector> #include <tuple> using Array = std::vector<int>; u... (by keskiverto)
Possible reasons for the loop that does not call a function more than once
 
Hello fellows, When I call the Func1 in the loop in Func2, it does not call the fucntion more than...
[5 replies] Last: Thank you so much for all these replies. @zapshe, thank you so much. Y... (by learner999)
Bracket problems
 
I think there's a problem with my Bracket alignments or is there any problem in my if -else statemen...
[3 replies] Last: Thank you guys you solved my problem!!! very much appreciated :) (by cplus2303)
Cyclic dependencies and forward declaration
 
Hi guys, I have a question to the following. Imagine two classes A and B that use one another. T...
[10 replies] Last: This, and a lot of other design issues, are discussed in this great bo... (by seeplus)
by Wedde
Handle cos, sin function.
 
I dont believe i get the correct results. Is something wrong with the way i use the cos and sin func...
[5 replies] Last: #include <iostream> #include <vector> #include <cmath> //double posi... (by lastchance)
August 2022 Pages: 123
  Archived months: [jul2022] [sep2022]

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