Questions tagged as 'c++'

1
answer

Can you use C ++ and C # using C programming?

If I put a code for a sotfware and this code wants to use the C, C ++ and C # languages, could it? Even if I use a compiler that reads all three?     
asked by 02.12.2016 / 14:51
1
answer

Code works sometimes yes and sometimes not

This is my code: #include <iostream> #include <cstdlib> #include <ctime> using namespace std; void exchange (int *arr, int i, int j) { if (i == j) return; int aux = arr[j]; arr[j] = arr[i]; arr[i] = a...
asked by 24.12.2016 / 20:56
2
answers

Is it possible to develop a C ++ application in Visual Studio to run on Linux?

I have to develop an application for Linux in C ++ and wanted to know if it is good to use Visual Studio 2017 on Windows for such a task? I wanted to know the pros and cons, because I saw that VS has an extension for it.     
asked by 15.09.2017 / 15:32
1
answer

QT - Identify coordinates of an image in a different sized QLabel?

Hello, I recently had a question about how to trace coordinates of a QLabel using the mouse cursor. It worked well for what I thought of doing. What I want to do is the following, I have an image that I project on the screen through a QLabel, I...
asked by 07.08.2016 / 03:19
1
answer

How do I get the position of the mouse (x and y) on the console? C ++

I have the following code: #include<windows.h> #include<iostream> #include <cmath> using namespace std; int main() { HWND myconsole = GetConsoleWindow(); HDC mydc = GetDC(myconsole); int x = 150; int y = 15...
asked by 14.04.2016 / 14:41
2
answers

How to fix multiple errors in this code?

Iammakingacodethatneedstocontain3vectors(registrationnumber,note1andnote2),relativeto6students,whichmustinclude:thefinalgradeofeachstudent;theclassaverage;ono.ofstudentswithagradebelowtheclassaverage.ImadethecodeasfarasIknow,butitdidnotcompile,...
asked by 15.09.2015 / 00:17
1
answer

Error Pointer to pointer in c ++!

I created a Matrix class, to manipulate an array. In the class declaration I have the following members (public): class Matrix{ public: unsigned char **mat; //ponteiro para ponteiro de uchar int nRows; //numero de linhas int nCols;...
asked by 26.03.2015 / 13:14
3
answers

Read saved objects in .dat file

How do I get the read function to read arquivo.dat every time I start the program? I'm writing objects to a file, and I need to read them every time the program starts. Problem: I'm having segmentation failure issues when trying to rea...
asked by 25.12.2014 / 17:31
1
answer

Palindrome in C ++

The code below works, receives what was typed and stores the same, but does not make the logic to show if it is palindrome or not and does not display the result for the user. Please, where did I go wrong and how to fix it? #include <ios...
asked by 09.10.2014 / 21:18
2
answers

C ++ - Use delete on objects allocated without new?

Hello, I have always used object-deletion in my c ++ projects with Qt since when I dynamically allocate them with the new operator, but in my last project that was relatively large, I began to feel a difference of performance according to its...
asked by 14.09.2016 / 17:15