
please wait
by KaiTang
About function pointer as map's value
|
Hello everyone, like this code class A { public: A() {} void show() { } int a; }; void* CreateA() { return new A(); } int mai... |
Sep 13, 2022 at 10:49am
[6 replies] Last: > Doing an explicit cast seems to work but not sure if it's guaranteed... (by JLBorges)
|
by seeplus
std::format_args
|
It is my understanding that std::format_args requires compile-time stated arguments. Is it possible to generate a std::format_args variable in some way at run-t... |
Sep 13, 2022 at 8:46am
[4 replies] Last: Thanks. That's what I thought. This topic came up in conversations ove... (by seeplus)
|
by JUANDENT
why use std::decay?
|
Why is it necessary to use std::decay and std::forward here: template<typename T> auto f(T&& val) { using rawVal = std::decay<T>::type; rawVal* tmp = ... |
Sep 13, 2022 at 12:05am
[1 reply] : Roughly, std::decay a. removes cv-qualifiers, b. removes references,... (by mbozzi)
|
by johnstro12
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, ability to use breakpoints and step thru execution, watch variab... |
Sep 12, 2022 at 9:20am
[4 replies] Last: @Peter87: _GLIBCXX_DEBUG was a really useful tip. Thanks (by kbw)
|
by JamieAl
Optimization: why is my Eigen code slow?
|
I just recently finished rewriting a code I had that used C++ arrays to include Eigen matrices instead. Unfortunately the Eigen code is slower. I read also that... |
Sep 10, 2022 at 7:20pm
[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 _CELL_H_ #include <iostream> #include <array> class Cell { ... |
Sep 9, 2022 at 10:35pm
[2 replies] Last: Thanks for the answer. I appreciate it. (by Cplusc)
|
by denver2020
string issue
|
I am trying to solve the below problem. https://www.chegg.com/homework-help/questions-and-answers/amazonian-team-responsible-maintaining-monetary-transactio... |
Sep 9, 2022 at 10:57am
[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 num = 0x11223344; char* tmp = new char; *tmp = num >> 24;//0... |
Sep 9, 2022 at 9:22am
[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 the link below you can take a look at the principle with a lit... |
Sep 8, 2022 at 12:48pm
[11 replies] Last: I didn't realize some orchestras tune their instruments to even higher... (by Ganado)
|
by Cambalinho
how convert position class to 'const POINT*'?
|
see my position class: class position { public: float X; float Y; float Z; float perespective; float foco; position(float posx = 0, float posy =... |
Sep 6, 2022 at 11:57pm
[3 replies] Last: The operation you're specifying is on the collection, not the contents... (by kbw)
|
by raijin011321
C++ LinkedList explanation
|
Please explain to me how these codes work. That will make me easily understand. Line# 11,12,13,14 Line# 26,27,28 Line# 40,41,42,43,44 #include "Stack.h" #inc... |
Sep 4, 2022 at 10:03am
[3 replies] Last: This code originally came from this post https://cplusplus.com/forum/g... (by seeplus)
|
by JamieAl
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 create a Vector of 2D matrices. Which will help with perform... |
Sep 4, 2022 at 5:16am
[10 replies] Last: @jonnin Thanks again. (by JamieAl)
|
by denver2020
c++ special characters
|
I am trying to solve the below using c++. Any idea how to display special characters using STL and open source libraries? https://www.chegg.com/homework-help/q... |
Sep 3, 2022 at 1:03pm
[16 replies] Last: Thanks everyone for your inputs,this thread can be closed. (by denver2020)
|
by denver2020
Buggy code
|
What is wrong in below code? class NonZeroSample{ protected: virtual intnxt = 0; public: int nxtNonZero() { int ... |
Sep 3, 2022 at 1:02pm
[4 replies] Last: Thanks to clarify this. This thread can be closed. (by denver2020)
|
by raijin011321
C++, Popped off
|
Hello, how to allow the user to enter how many items to be popped off? Please check my codes. #include <iostream> #include <stdio.h> using namespace std... |
Sep 3, 2022 at 12:07pm
[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. Error: Type name is not allowed. Here is the actual code: n... |
Sep 3, 2022 at 11:38am
[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/contest/269118/problem/A I'm using two different ways to do s... |
Sep 3, 2022 at 9:20am
[16 replies] Last: I was thinking of Barbara Gaskin's version from 1981. (by seeplus)
|
by jetm0t0
Quick question on for loops header
|
I keep forgetting how this works: for (T<ItemType>* tempPtr = headPtr; tempPtr; tempPtr = tempPtr->getNext()) { if (tempPtr->getItem() =... |
Sep 3, 2022 at 7:24am
[2 replies] Last: Oh that's awesome, and powerful! It really is count controlled secretl... (by jetm0t0)
|
by raijin011321
Linkedlist in a Class
|
Hello, please help me how do I put these codes in a class (.cpp and header file) #include <iostream> #include <stdio.h> using namespace std; class Node { ... |
Sep 3, 2022 at 6:16am
[8 replies] Last: Oh i see, its now working. Thanks a lot to those who help :D (by raijin011321)
|
by dorito200
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 to delete objects in some arrays (what the assignment is bas... |
Sep 2, 2022 at 11:00pm
[16 replies] Last: yes, another great alternative. And, if you noticed, all the alternat... (by jonnin)
|