Questions tagged as 'c++'

2
answers

I can not use char '&' Qt Creator

I'm trying to return a QString, which will be used as a URL and need to use '&' as a separator in the URL. However, when the character is placed in the QString, it breaks the URL and what should appear after the '&' does not appear. re...
asked by 07.08.2017 / 15:10
1
answer

Which way to delete element of a vector correctly? C ++

Can the same way be to delete an integer vector, or an object vector? Whenever an element is deleted, does the vector position have to be changed? Is the situation the same eliminating at the beginning or at the end? As an example: vector...
asked by 25.01.2017 / 22:58
1
answer

Porting Java code to C ++ or Python [closed]

I'm working on a project that was originally written in Java. I want to learn more about math and logic behind the code, and I had the idea of porting the code to another language. I thought of C ++ and Python. Which one has more simila...
asked by 31.08.2016 / 21:58
1
answer

Templates in c ++ can only be used once?

I have this code in c ++ and I'm getting an error: #include<iostream> using namespace std; template <class T> void setVector(T* v, int sizeOfV){ for(int i=0;i<sizeOfV;i++)cin>>v[i]; } void showVector(T* v, int sizeOfV){...
asked by 26.04.2017 / 02:46
1
answer

How to use sdl in Clion

I'm reasonably new to C ++, and I do not know how to use sdl in Clion. I've tried it in several ways, it's currently like this: CMakeLists: project(cppsdl) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -lmingw32") set(CMAKE_EXE_LINKER...
asked by 21.04.2016 / 22:47
1
answer

Why do the constructors have to have the same class name?

Is it really necessary for the constructor to have the same name as the class?     
asked by 30.10.2016 / 02:53
1
answer

Save two-dimensional array into EEPROM memory

I'm doing a program for Arduino written in C ++ to turn on and off leds when a button is pressed. I want to save the values of the LEDs that are on and the amount of brightness in an EEPROM memory. I thought of using an array, so the first el...
asked by 08.08.2014 / 16:33
2
answers

QT signal from C ++ to QML

I'm trying with QT 5 + QML to create an application where after opening the file using fileDialog it returns a message by a QT signal. The application opens using a QML and initiates a call to a SLOT in the class responsible. Th...
asked by 16.07.2014 / 23:50
1
answer

Find correct positions in the Matrix

I am having difficulties with this reasoning. I have a 4x4 array. I should fill it with 0 and 1 as long as the number 1 appears twice in each row and in each column, as in the example below. 1 1 0 0 1 0 0 1 0 0 1...
asked by 12.10.2014 / 05:28
1
answer

How to validate the price on Qt?

I would like to know how to validate the price on Qt, as follows: Examples accepted: 10,00 / 100,00 / 1.000,00 = true My code, (but is validating true: 10 / 100 ) bool ok; QLocale::setDefault(QLocale(Q...
asked by 17.03.2014 / 14:02