Questions tagged as 'c++'

1
answer

How to train two objects of different sizes for recognition in OpenCv

Hello, I'm using OpenCv version 2.4.11 to train the recognition of vehicle license plates for parking software. The problem is when training to identify the car plate, truck, truck where the boards used by them are of the same dimensions the cas...
asked by 06.05.2015 / 17:26
3
answers

What do I do when I get a bad_alloc error?

Before the question in question let's assume a scenario: I have a program written in GTK +; The program uses operator new to allocate resources; (not to be confused with operator new (std :: nothrow) ) At some point in the program I...
asked by 06.11.2014 / 18:27
0
answers

C ++ overhead in the method header

I've been analyzing the performance of a DirectX renderer through the Performance Profiler tool of VS2015 and it pointed me to an overhead in the header of a much-requested renderer method, as shown below: Parameters are passed by refer...
asked by 09.09.2016 / 19:52
1
answer

Code considered only at compile time may contain Undefined Behavior?

When designing a function that adds two values of any distinct classes, I can write the following generically: template <typename T, typename U> decltype((*(T*)0) + (*(U*)0)) add(T t, U u) { return t + u; } The interesting part is...
asked by 21.01.2015 / 16:42
0
answers

IntelliSense Error: 'No additional information available' in Visual Studio 2012 [closed]

Today my computer crashed (because of Google Chrome!) and I had to restart it. Visual Studio 2012 was currently open (and I lost a few lines of code I had not saved). The problem is that after this event, my IntelliSense simply stopped workin...
asked by 05.08.2015 / 23:18
1
answer

Abstract methods do not enforce implementation

I'm doing a work and I implemented an abstract method, the case makes a class inherit from it, but the compiler does not accuse error by the lack of implementation of the methods. Am I doing wrong? class online{ private: public:...
asked by 04.10.2018 / 15:12
2
answers

Where to create macros in C?

In terms of good programming practice, if I want to create a macro, for example, a macro that has more or less 30 lines of code, should I implement it in the file .c or .h ? What is good practice?     
asked by 16.07.2015 / 16:01
3
answers

Size of a String

A char in the C language takes up 1 byte in memory.Ex: char ch;//a variável ch esta ocupando 1 byte na memória And a vector of char better known as string , its size in bytes will be counted according to the vector numbe...
asked by 30.09.2016 / 16:21
2
answers

Pixel distribution algorithm

Well, lately I've been thinking about algorithms for creating random maps / maps and I've got a question that I'll post here for you to elucidate. Suppose I have green and yellow pixels. I'm not working with array, but rather a one-dimensiona...
asked by 04.11.2016 / 17:03
3
answers

Inline functions in iteration

In several articles, I read that adding an inline function within a while (for) generates an unnecessary consumption of system resources. Write: #include <iostream> inline int cubo(int n){ return n*n*n; } int main(){ for(int...
asked by 30.07.2014 / 14:37