Questions tagged as 'c++'

1
answer

Question with dynamic lists

In case I need to generate 5 random numbers, and insert them into a dynamic list, I have been trying, but the maximum I can is to generate and display them follow code: #include <iostream> #include <cstdlib>//Biblioteca responsa...
asked by 13.06.2018 / 05:01
1
answer

Writing in binary file

How do I write to any position of a binary file using the fstream library, without overwriting the content already inserted in the file?   I started trying like this: ofstream salvar; salvar.open(arq_dados,ios::binary); salvar.seek...
asked by 05.06.2018 / 00:55
1
answer

Equivalent to _kbhit () and _getch () in Ubuntu

People, In Windows I used to use the following code: int userQuit = 0; while (!userQuit) { cout << "Algo acontece...\n"; if (_kbhit()) { char key = _getch(); switch (key) { case 32: { cout...
asked by 29.05.2018 / 22:01
0
answers

Iterators std :: begin and std :: end in the circular list context

The std :: list class creates a circular list. When I create an iterator to go through I find myself with an ambiguous situation, which I exemplify: #include<iostream> #include<list> using namespace std; int main() { list<in...
asked by 28.05.2018 / 17:43
0
answers

c ++ sending to command line

I'm trying to use opnecv to track a red ball and print the x and y coordinates on the command line (I'm pretty new to c ++ so I do not know if there's any better place for it) I tried doing this like this: //calcular a posição da b...
asked by 28.05.2018 / 20:58
1
answer

char and constructors in c ++

I need a constructor for a class that has char vectors as attributes, like this: class Anthem { private: int Id; char Name[50]; char Country[50]; int Year; char Composer[30]; char Historic[20...
asked by 30.05.2018 / 20:04
0
answers

Why this code gives error?

Hello! I'm making software for microcontrollers. For Arduino , everything works ok, but for ESP32 it gives error, it does not compile. Here is the code: class Program { void(*app_start)(void); void *pBin; public: int...
asked by 02.06.2018 / 19:08
0
answers

Object Collision Check - C ++ with Allegro5

How do I collide moving objects in C ++ I want to know if the object can or can not walk, but if it has an object of it, it has to change direction. API: Allegro5     
asked by 30.05.2018 / 19:53
0
answers

Removal of txt files in C ++

I made a mergesort ordering program for a giant txt that can not exceed that user-defined primary memory limit, so I had to split 1 txt into several other temporary ones, the problem is, depending on how much memory the user program may create s...
asked by 14.05.2018 / 02:58
0
answers

Convert Ruby string to C ++ char pointer

I need to call a command from a DLL by Win32Api. LoadTexture = Win32API.new('System/SFML.dll', 'sfml_load_texture', 'p', 'p') I made two attempts: LoadTexture.call("folder/file.png") This second attempt only worked on wchar_t :...
asked by 19.05.2018 / 22:10