Questions tagged as 'c++'

1
answer

Create X11 Pixmap without window

To the function cairo_surface_t * cairo_xlib_surface_create (Display *dpy, Drawable drawable, Visual *visual, int width, int height); I need to provide you a Drawtable . I have no interest in the Drawtable being displayed, so...
asked by 10.05.2018 / 20:20
1
answer

Qt Parse of a Json (object within an array)

I have the next json { "Perfiles": [{ "Nombre":"Default", "E/S": { "EntradaHr": 6.45, "SalidaHr": 12.15 } }] } And the following code #include <QJsonDocument> #include <...
asked by 04.05.2018 / 00:50
1
answer

Icon associated with a file type in Linux

I have the following code to get the icon associated with a file type, implemented for Windows : #if defined(Q_OS_WIN) #include <QFileInfo> #include <QtWinExtras/QtWin> QIcon IconFromFile(const QString& fileName) { QIcon...
asked by 29.05.2018 / 05:56
2
answers

How to join two Arrangements? C ++

I am new to this, I am trying to unite the two arrangements to one, but it does not work out. #include <iostream> using namespace std; int main(int argc, char** argv) { int cantidad1, cantidad2; int valor1, valor2; int...
asked by 16.04.2018 / 02:37
1
answer

Capture data with getline

I have problems with this function ... it turns out that when I execute it, it is printed on the screen directly: name > date > ... , and I can not capture the name. I have the libraries <iostream>,<fstream>,<string&g...
asked by 24.04.2018 / 05:10
1
answer

Duda functions template

The doubt is clear and concise, I have a function template, something like this: template <typename T> T suma(T& a, T&b) { return a+b; } The question is, what do I have to say to tell you the type of data I receive? Is the co...
asked by 20.04.2018 / 11:56
1
answer

What is the similar setw (40) setfill ('=') of C ++ in C #?

When I was learning in C ++, I learned that with the iomanip library I could repeat characters like this: cout << setw(40) << setfill('=') << endl; Now that I'm in C # I do not know how to do it or if it's valid     
asked by 05.06.2018 / 23:20
2
answers

Error when trying to join vectors

I want to join the vectors vector1 and vector2 into a single vector vectorUnion #include<iostream> using namespace std; void muestraVector(int v[], int longitud); void unionVectores(int vector1[], int longit1, int ve...
asked by 23.02.2018 / 19:25
1
answer

How to clean the input buffer?

I'm trying to create a txt file, I have to enter 30 fields, but there comes a time when you read a cout and do not ask me for values, the problem is when you enter a data type int and then a text string, how can I clean the buffer so...
asked by 20.03.2018 / 02:05
2
answers

Release memory c ++ (delete)

I'm working with linked Lists (using pointers). In a memory reserve function (using new) as long as% co_of% In another function I release all the memory (with delete) and according to the project statement I should be able to generate a Li...
asked by 23.11.2017 / 17:15