Questions tagged as 'c++'

2
answers

Convert QVectorQString to int in C ++

I have a QVector and I want to convert it so I can make comparisons to find out which one is greatest. I tried to do this but it does not work: QVector<QString> vector; std::atoi(vector.value (i).toStdString ());     
asked by 01.06.2014 / 02:40
2
answers

What is it for {} inside the main

I came across a C situation I do not know and had never seen anyone use before. Within the main() method there are several keys, I believe to isolate the code however there is a same variable that in each block of code receives a value an...
asked by 21.08.2018 / 22:06
2
answers

Forcing backreference on regex

These days ago I asked here about a regex that validates dates and how to force the separators regex validated the following format: dd / mm / yyyy So based on it I was trying to force the separators using backreference in a regex that valida...
asked by 22.02.2018 / 22:04
3
answers

How do I check for any received type (uppercase or lowercase)?

How can I ignore the case for comparison with the default word? Ex: stack (default word to compare) Words that could be received: "sTAck" "STACk"     
asked by 15.01.2017 / 03:21
2
answers

Should I use int_least8_t or int_fast8_t?

I'm studying the type boundaries that c ++ 11 brought and noticed that there are officially several types of integers. In addition to the common int statement I can now declare: int8_t int_fast8_t int_least8_t In this question y...
asked by 28.02.2017 / 17:10
1
answer

Editing images using OpenCV without ready functions

I have the following image shown below and I need to turn it gray and then binarize it. Iusethefollowingcodetoshowitonthescreencv::Matimg=cv::imread("lena.jpg");// Lê a imagem no local onde ela é gerada(matriz) cv::namedWindow("RGB"); cv::im...
asked by 24.08.2015 / 23:41
1
answer

Why is the size of a struct not the sum of the sizes of its variables?

For example, the following code: #include <stdio.h> struct exemplo{ char letra; int numero; float flutuante; }; int main() { printf("Tamanho do char: %u\n", sizeof(char)); printf("Tamanho do int: %u\n", sizeof(int))...
asked by 24.04.2016 / 21:24
1
answer

How to get a string from a hbitmap

I have a function that captures the monitor image and creates a bitmap file with the result, but I would like it to return a string with the contents that the file would have, instead of writing it to disk. The function: int CaptureRegion(c...
asked by 27.11.2016 / 12:09
1
answer

Is it wise to use multiple paradigms in a C ++ project?

Would it be advantageous to use multiple paradigms in a project in C ++? For example, in a certain part of the code I use reactive programming , elsewhere I use OOP, and in another I use functional programming. Anyway, is there any problem in d...
asked by 03.12.2018 / 01:25
3
answers

How to implement std :: to_string for floating point?

This question may seem more like a request, but I've been researching it for 2 months and I do not know how to solve it. I need to implement std::to_string in C ++ ( without headers ) in a way that accepts decimal values ( float, doubl...
asked by 29.01.2014 / 20:39