Category "c++"

Loop for load multiples files (C++)

I´m trying to load all the files in a folder that have names from the form "file_i.csv". For this I write the program: void load_reel_set() { bool fil

Eclipse can't find linked libraries

I am working with the windows.h functions and everything works fine so far. But when I try to use functions which require me to link external libraries somethin

Windows Console (conhost) discards newline when output matches witdth of the window

I have a C++ application on Windows, that logs to stdout (via the Win32 api using WriteConsole). Each logline consists of some text and a trailing newline chara

tensorflow error This file requires compiler and library support for the ISO C++ 2011 standard

The result is below,I run the project stylegan2, but it fails. So I need help. The link is https://github.com/NVlabs/stylegan2 File "/home/ubuntu/worksp

is there away to get the elements out of strtok and restor them into another string to do operations on them?

this code is to take an equation from the user in the form of a string and then the program configures the confessions and store them in a dynamic array; now I

Program in assembly x86 [closed]

I recently made a program with C++ and ASM. Can anyone help me make this code a more efficient one , in the ASM part or both. I would really a

How to save/load values from board to file

Im using c++ 11, I need to save/load array to and from file. Its the battleship game its need to be done for both user and computer array but i have no idea how

Why introduce `std::launder` rather than have the compiler take care of it?

I've just read What is the purpose of std::launder? and frankly, I am left scratching my head. Let's start with the second example in @NicolBolas' accepted answ

Why is volatile deprecated in C++20?

According to cppreference, most uses of the volatile keyword are to be deprecated in C++20. What is the disadvantage of volatile? And what is the alternative so

QT: qmake not recognising 3dcore, 3drender

I am using qmake to compile my QT project. In my .pro file I have a line: QT += 3dcore 3drender 3dinput 3dextras When executing qmake myprofile.pro I get the

CMake & MinGW Compilation on Windows, without needing the -G "MinGW Makefiles" flag

I want to build my C++ applications from the Windows PowerShell command line using CMake and MinGW. When I do this in the "normal way," with these commands: m

How does printf("%d",x) work/interpreted?

I am wondering how exactly printf("%d",x) is interpreted. All I know that the compiler reserve a memory to put '%','%d','\0' and returns its address to printf,

Compilation issues with a simple ImGui(GLFW+OpenGL3) program on Linux

I am getting the following error while compiling a simple imgui+glfw+opengl3 program on GCC 11.2.0 on Pop!_OS (Ubuntu): [build] In file included from ../externa

Handling custom vector classes

I have come across many occasions where I want to have an item which is selected inside a vector, for this I have written the template class: // a vector wrappe

The configuration option popup for debugging a c++ project in Visual Studio Code does not appear

so I want to debug my .cpp program file but when I click on the Run and Debug button and proceed to select my debugging environment (C++ (GDB/LLDB)), the popup

std::enable_if based on expression using static constexpr member function

Is the following code legal C++11? #include <type_traits> template<typename T> typename std::enable_if<T::Data() == nullptr>::type test (T t

Remove Duplicates from sorted list not passing all testcases

This is a question on leetcode. For some reason my code only works for 7/164 test cases. i would like to know why my algorithm is not efficient. what is a solut

CPP program background waiting for jobs

I want to split up the following workflow of a C++ program: Read serialized data (1 sec, which is already very fast for that size) Search data (0.01 ms) Return

Ensure that char pointers always point to the same string literal

Given the code // somewhere in the program const char* p1 = "Hello World"; // somewhere else in the program const char* p2 = "Hello World"; is there a way t

Qt Window incorrect size until user event

I'm creating a screen where users can add certain tiles to use in an editor, but when adding a tile the window does not correctly resize to fit the content. Exc