Beginners - February 2024

Container questions (1,2,3)
 
Just read and practiced my vector/deque/list/forward_list/set/multiset containers and I wondered about this one. 1) Why did they make it so that a set is REQ...
[51 replies] Last: A compile time check would be one of the NP complete problems I believ... (by jonnin)
Shared variable between thread(ISR) and main()
 
Hello folks, I want to create a variable that will be shared between a thread (ISR) and main() I am working on embedded environment on linux os Basically...
[8 replies] Last: Second, I learned about circular buffer. I wonder if it is suitable ... (by kigar64551)
by Ch1156
Collision detection using bit manipulation
 
So while working on a small game I discovered that the usual if statements for collision detection work fine for single directions, but when I had collision in ...
[12 replies] Last: Using bool and simplified, consider: #include <iostream> #include <... (by seeplus)
Confused about dangling pointers on a parent-child class
 
I am trying to understand dangling pointers using a Base Class and a Derived Class. #include <iostream> // Base class class BaseClass { private: pr...
[15 replies] Last: A reference can also dangle for the same reason, the object referred t... (by George PlusPlus)
sizeof(integers)/sizeof(integers[0]) on vector<int> (x64) (1,2)
 
sizeof(integers)/sizeof(integers ) On x86 this works just fine, but on x64 the vector seems to reserve a long long (8 bytes) for each element but only uses ...
[22 replies] Last: IMO using != no matter what the layout of the container might be mak... (by SubZeroWins)
Operator overloading (1,2,3)
 
I am trying to understand operating overloading a bit better and I have 2 questions. 1)Why do we need a return of Date& in this part that is by the book? ...
[42 replies] Last: Oh, I thought they were the same thing. A null terminated character = ... (by SubZeroWins)
  Archived months: [jan2024] [mar2024]

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