Beginners - July 2024

by demhat
function declaration with MACROs
 
hi guys as I know function declarations are like this: void ClearBackground(Color color); however sometimes I can face some kind of function decl...
[7 replies] Last: And, for one question within the OP: Yes, there can be more than just ... (by keskiverto)
MPI runtime weird example
 
Hi guys, I have a weird mpi example where I don't understand the used runtimes. #include <iostream> #include <mpi.h> #include <chrono> #include <cmath> void...
[1 reply] : its hard to know what is really going on with caches, other processes,... (by jonnin)
by zzzhhh
Why do I have to surround parentheses in this fold expression?
 
template<typename... Args> void printVariadic(Args... args) { (... , (std::cout << args << ' ')); } printVariadic(1, 2, 3, 4); This code can compile and p...
[1 reply] : Because the standard defines a unary left fold expression as: ( ...... (by Peter87)
need some help
 
That seems pretty close to being right, why don't you post the whole program? In case anyone stumbles on this nonsense, the original post / author got sh-canne...
[11 replies] Last: George, I would avoid directly hyperlinking the profile, if you don't ... (by Ganado)
by colt
Simple tga writer not working correctly.
 
Hi. I did write code to write a simple tga file format file. Unfortunately, it does not seem to work as expected. The resulting image is always black, not ma...
[3 replies] Last: You might consider finding an already existing 3rd party library and u... (by deleted account xyzzy)
Namespace std not recognized in public API.h for shared library (1,2)
 
It has been quite a while since I was working intermittently on my project to write a C++ shared library for Basex. I finally managed to create a working combin...
[21 replies] Last: smart pointers are used as an 'owning' pointer. They 'own' the allocat... (by seeplus)
Segmentation fault (core dumped)
 
Hi, I get strange segfault error when working with hierarchy of c programs (3 stages) I can give a link to the sources, but first i will describe the issue: i ...
[6 replies] Last: Thanks folks, the error was due to a buffer overflow of char array I ... (by Jonathan100)
by zzzhhh
It is known that we can't initialize rvalue reference with lvalue, but why can function name?
 
It is said that we can't initialize an rvalue reference with an lvalue. For example: int i=0; int && irr = std::move(i); int && irr2 = irr; In the above code,...
[5 replies] Last: And the standard you cited is two floors above: "http://eel.is/c++dra... (by mbozzi)
  Archived months: [jun2024] [aug2024]

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