I'm trying to understand the basics of C++ classes and the different forms of copying a class to another one, I made a simple class that use a table as a stack and i created simple function for stacking/unstacking integers pileInt.h :
float b; printf( give us the float nummber \n ); scanf( %f ,&b); printf( the value of the float is %f\n ,b); I intered the value of a float and expect from the C code to give it back to me exactlly how it is
I'm using msvc, now I need a logger function that can:
acquire the caller's name automatically can receive variadic args just like fmt::format or std::format
I tried the following:
use macro, it works, but it's not easy to encapsulate into a...
I'd like to understand better why choose int over unsigned ?
Personally, I've never liked signed values unless there is a valid reason for them. e.g. count of items in an array, or length of a string, or size of memory block, etc., so often these...
I'm having an issue working with Leptonica version 1.80.0 on a Red Hat 9 machine. I'm using the function pixDeskewGeneral(...) to deskew some images before being processed by Tesseract for OCR text extraction.
I have a templated struct and I want to speed compilation times by separating declaration and implementation, using explicit template declaration (I'm using Kokkos 4.1, with Cuda backend, GCC 11.3 and Cuda 11.8).
#include struct Node { int x; }; Node f(int A, int B) { if (A 0) return {0}; return {C / D + (C % D != 0)}; } int main() { int n; scanf( %d , &n); f(1, 1); Node t = g(-1, n); printf( %d\n , t.x); } Then I use: g++-13 tmp.cpp -o...
I want to place a function void loadableSW (void) at a specific location: 0x3FF802 . In another function residentMain() I will jump to this location using pointer to function. How to declare function loadableSW to accomplish this. I have attached...
I have two classes a Parent class and a Child class (inheriting from the Parent class) I would like to know if it is possible to cast/transform a Child** to a Parent** with reinterpret_cast or something else? Or such thing is not possible
I wanted to check whether a g++ compiler-flag exists that warns me about nullpointer-dereferencing. When compiling this code with g++ (GCC) 13.1.1 and these compiler flags: -Wnull-dereference , -Wnonnull , still nothing happens. No warning, no...
i write a shared lib,named libTest.dll(windows) and libTest.so(ubuntu),when a executable program link the shared lib.how did i write the cmakelists.txt,just give the lib name 'Test' ,then it can automatically link to the correct shared lib like...
I am creating wrapper functions, that modify existing functions (targets). The targets are determined at runtime as pointers without type information ( void* ). Each of them has different parameters and return type. The wrapped functions are called...
một dãy số ban đầu rỗng. Người ta lần lượt Q thao tác, ở thao tác thứ i người ta chén thêm bi số ai vào cuối dãy số. Sau khi thực hiên Q thao tác, hãy cho biết số nhỏ thứ k trong dãy có giá trị bao nhiêu. điều kiện: 1≤Q≤10⁵, 1≤ai, bi≤10⁹, 1≤k≤ b1 +...
I was told to use the singleton pattern instead of having global objects, which have the “static” storage duration, to avoid the static initialization order fiasco. But now that I have C++20 modules, should I?
Static initialization order fiasco...
I have two applications, one server and other client, both written in C++ and Qt, but both of them also uses a C library that uses C socket methods to perform a socket communication between them (and this all in Linux).
I'm trying to figure out how it is possible to receive an OpenCV image from a Python in C++. I'm trying to send a callback function, from C++ to my Python module, and then when I call a specific python method in my C++ app, I can access the needed...
Вы не можете начинать темы Вы не можете отвечать на сообщения Вы не можете редактировать свои сообщения Вы не можете удалять свои сообщения Вы не можете добавлять вложения