General C++ Programming - August 2022 (Page 2)

Am I dealing with dangling references?
 
By defining methods of a class &&, and chaining the calls, am I dealing with dangling references?? ...
[5 replies] Last: std::move() is required; copy elision can't be applied to member obj... (by JLBorges)
Address and pointer
 
Let's say i have an int variable int number = 5 Does the expression "&number" returns a type i...
[2 replies] Last: Thanks (by Worldtreeboy)
ASCII to string
 
Hallo c-plus plus, Is there a way, to get the letter ASCII(code:10) to print to a string. I w...
[10 replies] Last: Glad you found that... I was trying to say as much, but I assumed you... (by jonnin)
What does this struct . do
 
Please explain to me what this code does struct sPickDropBuffer { DWORD OnlyDword{}; BYTE F...
[4 replies] Last: Thanks JLBorges , (by Hawlong)
by frek
Working with array (1,2)
 
Task description : A non-empty array A consisting of N integers is given. The leader of this array...
[30 replies] Last: Don't worry, I don't use Big-O anyway. I prefer Big Mama (by zapshe)
by ruzip
Steps in Loop in C/C++
 
What are possible ways to skip or step a variable in a loop in C/C++ particular in C only? In Basi...
[7 replies] Last: ... and can also be used where a condition is required - eg with if an... (by seeplus)
AVX and other SIMD
 
Does anyone have example of code that tends to generate avx or other simd instructions in the result...
[5 replies] Last: You could try looking at the generated code for parallel algorithms in... (by mbozzi)
by PacR
Help with iterator
 
Hi im trying to use iterator in line 41 of my code but it dont work please help. #include <iost...
[9 replies] Last: Possibly something like: #include <iostream> #include <list> class... (by seeplus)
ifstream and put it in a string
 
Hello C++'s, I am trying to open a TEXT file and put it in a string. string line; i...
[7 replies] Last: c++ : seeplus , thnx I works fine now. Tnx a lot (by nvthielen)
by helios
Bidirectional RPC
 
In most RPC systems, the roles of client and server are very asymmetric. All the server does is list...
[5 replies] Last: I am not sure there is a major package that does this by design. The... (by jonnin)
by frek
std::unordered_map (1,2)
 
We know that in associative unordered containers in STL, like std::unordered_map , the hash functio...
[20 replies] Last: note that a great deal of effort has been put into generating hash fun... (by jonnin)
Enum & vector returns a "not declared in this scope" error when it's included in the header.
 
I'm trying to make a simple Lexer that breaks up a string into characters and tokenizes them. But I ...
[4 replies] Last: Oh my gosh, how could I have missed that? Thanks again Peter, I apprec... (by gabriel11)
CreateWindow(TEXT("Edit") get string input
 
He, folks I have a control object. ( CreateWindow ) but can get the string in the TEXT edit window...
[2 replies] Last: He, Genade tnx for the help. string totalString; totalString = ... (by nvthielen)
This trick allows a member template to be called as a "copy ctor": but why?
 
Deleting the copy ctor with argument const volatile allows a member template to play the role of a c...
[3 replies] Last: Why is member template never called in this last case? because non-t... (by Cubbi)
by ruzip
Free up Global Pointers in C
 
How do I properly free up global pointers, specifically character pointers?
[5 replies] Last: Thanks guys, I now got a better understanding of this matter. also th... (by ruzip)
by frek
Do we still need class template argument deduction guide in C++20?
 
Hi, Here the deduction guide is not needed on most compilers: #include <iostream> template<typena...
[9 replies] Last: Yes, thanks. Here's an example that actually compiles: template <ty... (by mbozzi)
by Tima11
When I pass const char* as an argument in class constructor it changes its value.
 
I made a function which converts int to const char*. It works like this: https://ibb.co/6PxcP94 . Th...
[9 replies] Last: typically char is single quote: '1' I don't recall what happens when ... (by jonnin)
How to input a 2d vector into a file
 
Hi I have this code that has this input and I need to put it in the file and I do not know how, this...
[1 reply] : Here's one way to do it, there are faster ways to write to disk, but t... (by newbieg)
My 2d array is not out putting all the words (1,2)
 
I have this code which ask the user for how many words and makes a 2d array but the words the user i...
[24 replies] Last: I really do suggest dumping the C library random functions and learnin... (by deleted account xyzzy)
by ruzip
Macro or #define the 'struct' keyword
 
I would like to define the struct keyword to something else or perhaps use macro to add another keyw...
[7 replies] Last: Thanks for the info guys. I decided to just go for typedef. (by ruzip)
August 2022 Pages: 123
  Archived months: [jul2022] [sep2022]

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