Questions tagged as 'c++'

1
answer

Change code from windows to linux

How can I modify this code to linux? I need an alternative to #include<windows.h> to make this code: GetCursorPos(&cursor); x = cursor.x; y = cursor.y; Sleep(2000) SetCursorPos(x, y); mouse_event(MOUSEEVENTF_LEFTDOWN, x, y,...
asked by 21.07.2018 / 12:16
1
answer

How to use in devc ++ the cout and cin?

I've just started programming at the university. I have tried with fstream.h, iostream.h and none allows the dev. And if you wonder if you keep the code as c ++     
asked by 26.06.2018 / 14:37
2
answers

Doubt program with structures

The code works fine, but I do not know how I can do so by calling the function ' pedirdatos ' and enter everything, return to the main screen function, showing me the possibility of entering another contact or visit the contacts . When tr...
asked by 25.06.2017 / 10:43
2
answers

Problems when deploying the template to the TAD

In the exercise, ask to transform a non-generic TAD matriz , to a generic by template . In theory only you have to touch the header ( matriz.hpp ) and matriz.cpp . The project has two other files, prueba.cpp...
asked by 22.06.2017 / 20:05
2
answers

How to correctly use a switch case

Hello, I can usually do a check by doing an if: static const wchar_t *example=L"myprogram"; if (!lstrcmpW(((LVITEMW*)lparam)->pszText, example))//The lparam is a LVITEM* struct. { return 0; }...
asked by 31.03.2017 / 03:08
2
answers

When to use new in declaration of pointers and when this

When declaring pointers I have always used the following form: int *edad = &numero; But I only see in many places how, when declaring a pointer, they use something similar to: int *edad = new int; What is the difference between the...
asked by 14.09.2017 / 03:29
1
answer

cstdio vs fstream [closed]

Comparing the two file streams libraries like cstdio and fstream, I come to the conclusion that they do exactly the same thing. I'm studying C ++. Is it better to continue with the "evolution" of the language and continue with fstream? The only...
asked by 12.04.2017 / 04:03
1
answer

I do not understand the behavior of the variables

I have solved an exercise for my student career. main () int cantAlumnos = 0; int A,B,C,D,R=0; int nota; while (cantAlumnos < 12) { cout << "Ingrese Nota: "; cin >> nota; if ((90 <= nota)&&(nota <= 10...
asked by 07.05.2018 / 03:09
2
answers

Override toString in a C ++ class inheritance

I'm trying to implement a toString() method for the classes below but I'm not making it work, when you access the method, only the one that is in class Vehiculo is executed. What am I doing wrong? Can I have to use override ?...
asked by 24.03.2018 / 22:48
1
answer

Doubt about inheritance and call to functions in base class

The doubt has come for Qt, but it is C ++. If I have a class structure like this: (I only define eventFilter ) class DelegadoBase : public QStyledItemDelegate { Q_OBJECT public: explicit DelegadoBase(QObject* parent=nullptr);...
asked by 13.11.2017 / 18:44