Category "c++"

How can I calculate the tens place value of 2^100 in C++?

How can I calculate the tens place value of 2^100 in C++? I tried this; #include <cmath> #include <iostream> using namespace std; int main(){

gdb <error reading variable> for any string object

Lets take this very simple program here for example: // test.cpp #include <string> #include <iostream> using namespace std; int main() { strin

parse libcurl response with nlohmann json or rapidjson

My libcurl code returns me a json string: {"object":"user","attributes":{"id":000,"admin":false,"username":"un","email":"[email protected]","first_name":"leopold

Decrypt using RSA private key using windows crypto api

I have a RSA private key in xml format. <?xml version="1.0" encoding="utf-16"?> <RSAParameters xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xm

linux socket lose data when a delay is added before read

I am learning linux socket programming, I expect that server can read data, even I add a delay but it just drops the buffer data, and receive the recent data, t

uWebSockets undefined references in eclipse cpp ide

I'm new to c++ and i miss many knowledge about it. Mostly i get the work done by try and error. But now i stuck on setting up a test project for a websocket se

libpq SELECT loop and UPDATE within the loop

I have a C++ program that does something like the following: PGresult* res = PQexec(conn, "SELECT id, foo FROM tbl WHERE some_condition"); for (int r = 0; r <

I have a project in college and I do some of the requirements [closed]

**my project talk about Shape hierarchy for every shape needs Inheritance, Polymorphism and Files I/0 I did a simple thing of the requirements

C++ why max of 64bit double has 308 digits?

In my environment (Win10 64bit, VC++2019 and 32bit project), sizeof(double) is 8 bytes, the max value should be 1.84e19. But std::numeric_limits<double>:

【SOLVED】LLVM DILocation: extract information from metadata

I wanna get value and 861 from a return instruction, for example ret i32 %3, !dbg !861 and it's metadata !861 = !DILocation(line: 8, column: 5, scope: !857). Bu

Multiple definition running MF Media Session Playback Example using Windows SDK 10.0.22000.0

I'm new to Media Foundation, and I downloaded the code from the media session playback example, and the Windows 11 SDK. I used the following makefile to compile

How i have to configure VS Code to don't get a "undefined reference" error message?

My work environment : EDI: Visual Studio Code C ++ Compiler: GCC Extensions: Microsoft C / C ++ .run Code Runner My source code : main.cpp #include <

Loading & Saving Bitmap Images In OpenCV (OpenCV Version = 3.1.0)

My problem is simple at least as I see, or how I feel about it. I tried to load and write Bitmap images with OpenCV in C++ and got sucessed in it, my problem is

May a compiler store function-scoped, non-static, const arrays in constant data and avoid per-call initialization?

In reading How are char arrays / strings stored in binary files (C/C++)?, I was thinking about the various ways in which the raw string involved, "Nancy", would

64 bit Vivek's Virtual Camera

I have build 32 bit famous Vivek's VCam available here http://tmhare.mvps.org/downloads.htm and it successfully works and shows in 32 bit video conferencing sof

Which STL data structures with an incomplete type stored can be used as a class member?

As far as I know, since C++17 some STL data structures may "exist" with an incomplete type as the template parameter which describes the type stored. For exampl

Is most vexing parse a formally defined concept

I was reading an SO post where one user made the following comment: Also note that ArrTest<int> ar(); uses most vexing parse. But another user said the

Error: declaration of ‘freefunc’ shadows a global declaration

While building application using openssl 1.1.1d I am getting below error, I know C++ but not an expert. Spent lot of time but still did not get any clue. Can s

Can substitute PyCharm Professional for CLion - primarily for python

My favourite editor by far is PyCharm, mainly because I am most comfortable with Python. I am subscribed to the professional package, but I am interested in pi

Inheritance and std::shared_ptr in Cython

Suppose I have the following simple example of C++ inheritance in file.h: class Base {}; class Derived : public Base {}; Then, the following code compiles; tha