Questions tagged as 'c++'

2
answers

Error instantiating an object of a class in QT Creator C ++

I need to create a AgregarProyecto method, which allows you to add a new project to a list. My problem is this: When wanting to make an instance of class proyecto , which receives 3 arguments, I get the following error:    err...
asked by 12.05.2017 / 22:17
2
answers

What would be the best way to handle the firing rate of the ships in my game?

In my current code the enemy ships fire each frame of the game. How can I make those shots to be every so often, 2 seconds for example? My code: Bullet.h: class Bullet { private: sf::Sprite sprite; sf::Vector2f speed; int posX, posY;...
asked by 04.05.2017 / 21:25
1
answer

c ++ templates syntax

How do I define a friend method in this template with exta parameter? #include <iostream> #include <cstdio> template <typename T> class Myclass{ private: T m_a; public: getm(){ return m_a;}; MyClass(T a)m_a(a...
asked by 01.03.2017 / 14:30
1
answer

Warning: shadow a member of this

I have the following problem. I need to remove all warnings from a source and there is one (I have it in several sources) that says the following, I'm using linux and cmake: /mnt/clas/Source/CLAS/lashandle.h: In constructor ‘LAS_HeaderSectionV...
asked by 20.02.2017 / 16:05
1
answer

Substrings in c ++

You see, I have to do a pseudo code test tomorrow and now I'm getting a bit involved with the theme of strings ... Reviewing I was doing an exercise that asked us to do a program that said if the first string was substring of the second one, tha...
asked by 01.02.2017 / 12:35
1
answer

Error LNK2019 and LNK 1120 visual c ++ 2012 using SDL

I am starting to use SLD and SDL_image I have searched for error information and in most cases it is due to a bad configuration with the linker in visual studio 2012, however I have used the solutions shown, but they do not affect it. I present...
asked by 31.03.2017 / 13:28
1
answer

Why does not this code work in Qt? creating rule in registry

Hi, I'm creating a rule in the registry using c ++ with QT and the windows function for it incorporates the following libraries: #include <iostream> #include <windows.h> #include <conio.h> Then I create the rule using the...
asked by 04.02.2017 / 00:26
1
answer

I get an error when using blockinput

Hi, I am modifying a small application in c ++ that allows me to take control of my mouse and my keyboard, the code is as follows: #include <windows.h> #include <conio.h> #include <stdio.h> int main() { HINSTANCE hDLL =...
asked by 29.01.2017 / 13:07
2
answers

Linked list loads values sometimes

I'm doing a program with a menu to load, delete and display a linked list through the list and node class. The problem is that sometimes all the values are loaded normally, and sometimes the program crashes after loading one or two values. If I...
asked by 12.01.2017 / 05:37
2
answers

C ++ array bound is not an integer

Hello, I'm doing a program that manages the entry and printing of data of employees of a company This is my code: #include <iostream> #include <stdlib.h> #include <windows.h> #include <conio.h> #define TECLA_ARRIBA...
asked by 03.01.2017 / 20:17