Questions tagged as 'c++'

3
answers

What is the cost of calling many functions?

Recently, in the face of a discussion on Clean Code and best programming practices, a co-worker commented that in his previous job there was a lot of resistance from other programmers to begin dividing code and make it more readable. The mai...
asked by 15.02.2017 / 20:29
0
answers

Create a resizable window

Hello, I've been able to create a console window that does not show the scroll bars: CONSOLE_SCREEN_BUFFER_INFO csbi; int columns, rows; COORD size; COORD BufSize; while(TRUE) { size = GetLargestConsoleWindowSize(GetStdHandle(STD_OUTPUT_H...
asked by 17.07.2018 / 13:22
1
answer

To learn C ++ is it necessary to learn C?

If I want to learn about C ++, do I need to learn C before or are they different things?     
asked by 10.12.2018 / 12:40
1
answer

Variable pointer is declared null, but member function normally executes

Below is an example of the code I'm trying to execute. //main.cpp #include <iostream> using namespace std; class A{ public: A(){} ~A(){} void teste(){ cout << "Teste" << endl; } }; int main(){...
asked by 28.09.2014 / 14:17
2
answers

How to use random in C ++?

I would like an example of using the random in C ++ because I need to use it but I do not know how it works.     
asked by 16.05.2015 / 17:16
1
answer

Optimize collision between particles

I need to optimize to the maximum the algorithm that makes the collision between the particles, is there anything that can be done for this? And I also want to add a background image, is it possible? Follow the code canvas.cpp: canvas::canv...
asked by 18.05.2014 / 02:00
2
answers

Get Screen Resolution C ++

I am developing a system and would like to know if there is any function / library, anything, to get the screen resolution, if it is for example: 1280x720, 1920x1080, 1366x768, etc... Is there any way to check this in C++ ?     
asked by 11.03.2016 / 19:49
2
answers

How to do an "equivalence" of IO in Java and C ++?

I made the following code in C ++: #include <iostream> template <typename type> class Foo { public: Foo(type FooTest) { std::cout << "Foo " << FooTest; } }; int main { new Foo<double>(...
asked by 01.03.2014 / 03:25
2
answers

C ++ (basic): for, references and syntax

My teacher introduced this role to us: void escala(std::vector<double> &v, double fator) { for (auto &vi:v){ vi *= fator; } } It serves to multiply all elements of a vector by an already predefined factor. I h...
asked by 07.05.2018 / 13:20
2
answers

What is "stdafx.h" and what is its importance?

When creating a C ++ project in Visual Studio, it automatically brings a line in the main file: #include "stdafx.h" As I started the language study, seeing some " hello world ", I did not find this line in the examples. When removing thi...
asked by 20.05.2017 / 03:20