General C++ Programming - September 2022 (Page 3)

About function pointer as map's value
 
Hello everyone, like this code class A { public: A() {} void show() { } int a;...
[6 replies] Last: > Doing an explicit cast seems to work but not sure if it's guaranteed... (by JLBorges)
std::format_args
 
It is my understanding that std::format_args requires compile-time stated arguments. Is it possible ...
[4 replies] Last: Thanks. That's what I thought. This topic came up in conversations ove... (by seeplus)
why use std::decay?
 
Why is it necessary to use std::decay and std::forward here: template<typename T> auto f(T&& va...
[1 reply] : Roughly, std::decay a. removes cv-qualifiers, b. removes references,... (by mbozzi)
Debug build but with STL optimized like release build
 
Is it possible to compile the application code I write in a "debug" version (i.e. with symbols, abil...
[4 replies] Last: @Peter87: _GLIBCXX_DEBUG was a really useful tip. Thanks (by kbw)
Optimization: why is my Eigen code slow?
 
I just recently finished rewriting a code I had that used C++ arrays to include Eigen matrices inste...
[18 replies] Last: In addition EcalcPotSourcek_inertia doesn't do anything as far as I c... (by JamieAl)
by Cplusc
variable can't be defined in namespace
 
Hello forum, I defined a header file name Cell.h as bellow, #pragma once #ifndef _CELL_H_ #define ...
[2 replies] Last: Thanks for the answer. I appreciate it. (by Cplusc)
string issue
 
I am trying to solve the below problem. https://www.chegg.com/homework-help/questions-and-answer...
[10 replies] Last: Note that the sort order for treating the ids as strings or as numbers... (by seeplus)
by t im
Assign unsigned int to char
 
What will happen when assigning an unsigned int to char? Just as the code below: unsigned int nu...
[1 reply] : A prvalue of an integer type or of an unscoped (since C++11) enumer... (by JLBorges)
by Geckoo
Sound by algorithm
 
There is a way to generate sounds according to an algorithm. It's very weird, but interesting. At th...
[11 replies] Last: I didn't realize some orchestras tune their instruments to even higher... (by Ganado)
how convert position class to 'const POINT*'?
 
see my position class: class position { public: float X; float Y; float Z; float perespe...
[3 replies] Last: The operation you're specifying is on the collection, not the contents... (by kbw)
C++ LinkedList explanation
 
Please explain to me how these codes work. That will make me easily understand. Line# 11,12,13,14 Li...
[3 replies] Last: This code originally came from this post https://cplusplus.com/forum/g... (by seeplus)
How to create 3D matrix in Eigen
 
I am trying to build a 3D matrix in C++ using Eigen. I read online that instead of 3D matrix, I can ...
[10 replies] Last: @jonnin Thanks again. (by JamieAl)
c++ special characters
 
I am trying to solve the below using c++. Any idea how to display special characters using STL and o...
[16 replies] Last: Thanks everyone for your inputs,this thread can be closed. (by denver2020)
Buggy code
 
What is wrong in below code? class NonZeroSample{ protected: virtual intnxt = 0;...
[4 replies] Last: Thanks to clarify this. This thread can be closed. (by denver2020)
C++, Popped off
 
Hello, how to allow the user to enter how many items to be popped off? Please check my codes. ...
[4 replies] Last: Oh thanks i got it. (by raijin011321)
by Tima11
I get an error when trying to get value from the class in another class.
 
Hello. I get an error when trying to get value from another class which are also in one big class. E...
[3 replies] Last: Thanks keskiverto! I experimented with your solution to this problem a... (by Tima11)
Strange error in string::substr
 
I'm solving a problem in codeforces link: https://codeforces.com/edu/course/2/lesson/2/3/practice/co...
[16 replies] Last: I was thinking of Barbara Gaskin's version from 1981. (by seeplus)
Quick question on for loops header
 
I keep forgetting how this works: for (T<ItemType>* tempPtr = headPtr; tempPtr; tempPtr = tempPt...
[2 replies] Last: Oh that's awesome, and powerful! It really is count controlled secretl... (by jetm0t0)
Linkedlist in a Class
 
Hello, please help me how do I put these codes in a class (.cpp and header file) #include <iostr...
[8 replies] Last: Oh i see, its now working. Thanks a lot to those who help :D (by raijin011321)
For loop not iterating through array
 
Hey yall, got another question for everyone. I'm working on an assignment for class and I am trying ...
[16 replies] Last: yes, another great alternative. And, if you noticed, all the alternat... (by jonnin)
September 2022 Pages: 1234
  Archived months: [aug2022] [oct2022]

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