Category "c++"

Qt 5.1.1: Application failed to start because platform plugin "windows" is missing

Edit: Some people started to mark my question as a duplicate. Do not forget that many similar questions existed when I asked this one (see e.g. the list below).

std::regex escape special characters for use in regex

I'm string to create a std::regex(__FILE__) as part of a unit test which checks some exception output that prints the file name. On Windows it fails with:

Finding the 1500000th Fib Number Using C++

I wrote the following code to find the 1500000th Fibonacci number(Please ignore horrible indenting, I wrote this in about 2 minutes). I need it as a string. Thi

How to check that SDP service record was registered correctly in C++/Linux

I am trying to register my bluetooth SDP service in C++ linux as shown here: Example 4-9. Describing a service Where or how can I check exactly that the servic

How to order strings case-insensitively (not lexicographically)?

I'm attempting to order a list input from a file alphabetically (not lexicographically). So, if the list were: C d A b I need it to become: A b C d Not the

Get std::set comparison as function parameter / complemet of a set without universal set

I have this .cpp file and I have to write the methods set_union, subset, complement, and contains. My two problem is first: How can I have a complement without

Convert json value to int in c++

I'm reading a json value in c++ using Json::Reader reader and the value is stored in Json::Value root This root contains "age" and "id" and I want to conve

POST form data using WinInet c++

I'm trying to make this program connect to a website and submit form data in order to login, but I don't know what I'm doing wrong. I have heard of others like

Unable to link libclang with cmake on VS2017

A while ago I wrote a code generation program to use in my 3D game engine. I added a target to my cmake files, linked libclang with it as I'm using that for par

Count the number of occurrences of each letter in a string

This is my logic. I wrote function for counting the no. of occurrences of each letter in a string. But this doesn't work correctly. Correct me. void countChar(c

Count the number of occurrences of each letter in a string

This is my logic. I wrote function for counting the no. of occurrences of each letter in a string. But this doesn't work correctly. Correct me. void countChar(c

launch an exe/process with stdin stdout and stderr?

With C++ how do i launch an exe/process with stdin stdout and stderr? I know how to do this in .NET and i remember using popen in the past but popen seems to al

How to use an operator from a specific base class on multiple inheritance context on C++

I'm writing some C++ codes, and I can't compile the following code on g++. It only says that std::string hasn't a method named "operator==". I know it's not tru

What is the fastest way to check if any files in a directory tree have changed?

Currently I'm checking against an XOR Checksum of the modified file time (st_mtime from fstat) for every file in the tree. I'm coupling this with the number of

What is the fastest way to check if any files in a directory tree have changed?

Currently I'm checking against an XOR Checksum of the modified file time (st_mtime from fstat) for every file in the tree. I'm coupling this with the number of

Use of a functor on for_each

Why does the for_each call on functor doesn't update sum::total at the end? struct sum { sum():total(0){}; int total; void operator()(int element)

Sum of two chars in C/C++

In C/C++ when I want to find sum of two chars - I get result in int. For example: #include <stdio.h> int main(){ char a = 'a', b = 'b'; printf("%d

Inheritance of copy constructors in C++17

Consider the following example: struct Parent { Parent (); Parent (const Parent &); }; struct Child : public Parent { using Parent::Parent; }

Is there any method to abort cin or scanf

I have a multithreaded program in which on thread waits for input through a terminal and the other will get data from the socket. Is there any way to abort firs

Would float point format be affected by big-endian and little endian?

I know the integer format would be different between big-endian machine and little-endian machine, is it the same for float point format (IEEE 754)?