Questions tagged as 'c++'

1
answer

How to develop a basic game using opengl that accepts keyboard commands [closed]

I tried to follow the source of a tutorial Metar Gearn Nanna because it was interesting to create a game in opengl and c ++, could be something simple, with precarious validations, just so I can understand the concept, I learned to draw triang...
asked by 01.07.2014 / 21:55
1
answer

How to use a template as a type on a map?

Is there any way to use template as type in a map in C ++ 17? template<typename T> std::map<std::string, T/* tipo desconhecido, pode ser qualquer tipo */> map_exemplo;     
asked by 01.10.2018 / 18:39
1
answer

Infinite Loop in Height Growth Analysis

Gustavo has 1.40 meters and grows G centimeters per year, while Juliano has 1.10 and grows by centimeters per year. My program is giving an infinite loop when I execute. #include<stdio.h> int main() { float g,j,gus=1.40,jul=1.10; i...
asked by 15.09.2018 / 01:10
1
answer

Put string in an array of characters

I am learning character array and wanted to do a simple program in which I create a 200x100 character array, put a string at position 0 and print it out. This is part of a larger program I'm doing, but I need to understand how to insert a...
asked by 18.06.2018 / 19:44
1
answer

static int in C ++ class

Hello, the following code is displaying the error to the right: #include <iostream> using namespace std; class teste { static int x; public: teste () { x++; } } t1; int main () { return...
asked by 17.06.2018 / 05:21
1
answer

C ++ program stops responding when calling a function for the second time

I'm doing a simplified Pokémon-style game, but it's stopped responding when I call InitializePokemon a second time, I'm not finding the problem because it works normally with the first one and it locks in the second. Theprintofthevaluesisjus...
asked by 25.05.2018 / 22:35
1
answer

List sorted C ++ struct

I need to do a job with this struct and it contains insert, search and delete by year and impression. Only I'm with doubt in the following code. I need it right after the insert is sorted. struct mundial{ int ano; char sede[10];...
asked by 29.05.2018 / 19:52
1
answer

Doubt binary search c ++

I was able to resolve this issue as follows: #include <iostream> #include <algorithm> using namespace std; int contar_pares(int y, int x[], int tam){ int cont = 0; for(int i = tam; i > 0; i--){ for(int j = ta...
asked by 21.09.2018 / 03:07
1
answer

Check if file has already been copied

How to check if the formula.exe file has already been copied to the c:\ directory, and if it has not been copied create a copy of it. #include <iostream> #include <Windows.h> #include <lmcons.h> #include <std...
asked by 24.05.2018 / 08:47
2
answers

Recursion even numbers in C ++

The purpose of the code below is, through a recursive method, to return the number of even numbers between two numbers placed by the user. I can not understand why my quant method only returns 0. #include <iostream> int quant(int...
asked by 27.03.2018 / 02:40