Category "c++"

How to take input 128 bit unsigned integer in c++

I am new to c++. I want to take input a unsigned 128 bit integer using scanf and print it using printf. As I am new to c++ , I only know these two methods for i

Error message "Undefined reference for std:string" [duplicate]

I have some code that reads the name of the file from arguments and outputs that file into the command line: #include <stdlib.h> #includ

Joining two characters in c++

My requirement is to join two characters. For example int main() { char c1 ='0'; char c2 ='4'; char c3 = c1+c2; cout<< c3;

Including <termios.h> and <asm/termios.h> in the same project

What I want to achieve: I want to set custom baud rate values for some tty*-like UART-mapped terminals. How: The only way I found by far is to use the struct t

Integrating x86 assembly in C++ project for old MS-DOS system information program

I'm new to C++ programming and have always wanted to write a system information program for MS-DOS. I'm currently using the latest DigiMars C++ compiler and MA

Getline & cin.ignore in c++

I know there are similar questions to mine, but I checked alot of them and didn't find the answer so I hope someone can help me. So what I am trying to do is st

Windows SetTimer() vs using SleepConditionVariableCS()

I currently have a timer implemented using tbb::condition_variable which under the covers uses native Windows call SleepConditionVariableCS() . One of my co-wor

What could be the source of this aliasing?

I am manually raytracing a 3D image. I have noticed that, the farther from the 3D image I am, the bigger the aliasing. This 3D image is basically a voxelized r

Compress string with GZip using qCompress?

I have a string of hex data (0a000a0165787a... etc) that I write to a file like this: void Output(QString FilePath, QString Output) { QFile file(FilePath);

Convert an int array to a single int

I'm trying to convert array[]={1,2,3} into a int number=123; how can I do that ? my code is this: int main() { int array[]={1,2,3}; int number;

Vulkan: Errors when adding 3rd descriptor

I have a Vulkan program that has descriptors for a Uniform buffer and a Combined image sampler. I tried to add a 3rd descriptor to for a Dynamic Uniform buffer

VSCode "go to definition" not working

I installed Visual Studio Code 1.1 with the C/C++ extension, opened my C++ project and tried to use "Go to definition" in vain. The "Go to definition" is not w

What is the purpose of std::function, and how to use it?

It is necessary to me to use std::function but I don't know what the following syntax means. std::function<void()> f_name = []() { FNAME(); }; What is

Calling javascript function in c++ with emscripten embind

This question comes in two parts. What I want to do is to put most of my program logic in c++ classes and some view related function in js (like DOM manipulatio

How to run multiple threads in C++ code

I'm a beginner for c++. I wrote a program to extract data from one DB and store those data to another DB. I just want to add multiple threads to speed up the pr

How to set fix directory for output file in V4 Printer Driver

I am working with V4 printer driver, i need to store output xps file to a specific folder instead of letting user select output folder.

I can't build c++ files anymore

I think i deleted some files i shouldn't and now when i try to build files in Sublime Text it says "g++ is missing" and in VS Code it says "#include errors dete

Get exit status of a process in bash

I have a c++ executable named Test. I want to find out the GetExitCodeProcess() code when the execution is completed. I can find out the status code by writin

How to get free space of all logical drives of hard disk using WMI in C++?

I would like to calculate free space of entire hard drive using c++ and WMI. For example. if HDD contains 3 logical drives say C: , D: , E: and each logical d

Can't open compressed file

I'm trying to compress a text file with QT: QFile inFile("d:\\build\\Directories\\Debug\\files\\developer.txt"); bool open_file_result = inFile.open(QIODevice: