Questions tagged as 'c++'

1
answer

code in C, url = inet_ntoa (* (struct in_addr *) ip-h_addr); I do not understand what is happening.

I was studying sockets for this material link and I came across a code that I do not understand what is going on. The code part is this: struct hostent *ip; ... // função da lib netdb.h para converter ai nosso host para IP ip = gethostbyna...
asked by 20.07.2018 / 12:31
2
answers

Image Processing? Doubt about the theme and usability

Talk, how are you? I have a question if it's the same name as the Image Processing I do not know if you have a look around there are some applications that bring such a proposal. There is a translation of words, which when placing the camer...
asked by 05.09.2018 / 01:17
1
answer

How to start an array with the value that the user type is possible?

If all allocated memory is defined at compile time, then how is this possible: int num{0}; cin >> num; int array[num]; As far as I understand, this could only be possible if you use dynamic memory allocation.     
asked by 19.06.2018 / 15:14
1
answer

How to compile C ++ in VisualStudio using linux inside windows

A friend said that he has to do this compilation by VisualStudio and run on a "subsystem" linux     
asked by 31.05.2018 / 18:25
1
answer

How to put classes inside vector and manipulate variables with push_back?

It sure is something simple, but I researched and did not understand how to do. If I have, for example, the following class with two variables: class x { public: int var1, var2; }; I want to create a vector of this class, so I...
asked by 29.05.2018 / 01:54
1
answer

How to optimize this code (Time Limit Exceeded)?

This code is a possible solution to Problem 1211 in the Online Judger URI. On my pc it runs normal for test cases, but on the platform I get the Time Limit Exceeded message. Any idea of optimization? #include <iostream> #include <stri...
asked by 03.07.2018 / 05:09
1
answer

How to access elements of a vector of a type defined by struct?

In my code, I made the following struct declaration: struct material { int idmaterial; double rho; double precokg; }; I wanted to run this function, which reads the data from a file: std::vector<material> le_material(std...
asked by 14.05.2018 / 17:19
1
answer

Error using OpenGL GLM GTX library

I am trying to compile in Ubuntu Linux a project that uses the quaternions to rotate 3D objects in the glui library, when I compile the code the system reports the following error: The Code says that the error has something to do with the GLM...
asked by 05.06.2018 / 22:59
1
answer

Pointer and Memory Allocation

I know which pointer stores memory address. And a variable stores a value. But taking into account that I have a class class player {} and I create a variable player p; and a pointer instance player *np = null; What's the di...
asked by 09.04.2018 / 03:50