Questions tagged as 'c++'

2
answers

Point inside a polygon

I need to create a function that checks whether a point is inside a polygon. For that, I researched the internet some solutions that could help me. I found one that seems to be of great help, but in one of the functions needed to run the main fu...
asked by 27.06.2017 / 17:28
1
answer

C ++: Error with Function Template

I've created a function using template, as shown in that answer , like this: utilits.h ... template<typename T> bool theres(T a, vector<T> b); ... utilits.cpp ... template<typename T> bool theres(T a, vector<T>...
asked by 27.06.2017 / 23:10
2
answers

About headers in C ++

Some doubts arise specifically about creating headers: If I create a test.h file, and another test.cpp, as the C ++ compiler does to relate the test.cpp file to the test.h file, that is, what are the criteria used? What prevents the settings...
asked by 03.08.2017 / 18:21
1
answer

Help on logic conditions and repetition in C ++

I have the following verification code to know if a certain number belongs to a vector. I could not think of a more accurate way to make the program say that the number DOES NOT belong to the vector, just that it belongs and what its position wi...
asked by 04.08.2017 / 05:36
1
answer

How to use OpenMP Lock Routines?

I need to create 5 easy-to-understand algorithms for each of the locking functions below in C or C ++ to be able to exemplify the operation of each and present to the staff in my room. omp_init_lock_with_hint omp_init_nest_lock_with_hint...
asked by 14.05.2017 / 19:36
1
answer

How to apply "goto" in quicksort? (c, c ++)

I'm doing a job for my college where I ask that a quicksort algorithm be done in C, using "goto" as much as I can. In the code below I applied "goto" to my knowledge, but I would like someone to help me apply "goto" to the rest of the algorit...
asked by 18.04.2017 / 04:16
2
answers

How to omit certain arguments for which default values were given in the function's prototype parameters?

How to omit specific function arguments in C ++ for which standard values were given in function prototype parameters? For example, how to omit the second argument (b = 4 by default), passing the first and last? #include <iostream> us...
asked by 05.04.2017 / 12:23
1
answer

How to get latitude / longitude of a geo address using Qt c ++ in windows?

Is it possible to get the coordinates (latitude and longitude) of a geographic location using only the address in Qt c ++? I know the libraries QGeoCoordinates, QGeoLocation and QGeoAddress, but I do not know if it is possible to get coordina...
asked by 06.04.2017 / 17:34
1
answer

Menu with Polymorphism

I'm creating some examples to learn polymorphism more deeply, but in the original code, all functions work correctly. Original code: #include <cstdlib> #include <iostream> class Mamifero { protected: int idade; public:...
asked by 10.12.2016 / 12:57
2
answers

Converting a vectorstruct in C ++ in C

I'm trying to adapt a C ++ function in pure C. I changed the names of the variables and structs because it is not the case. typedef struct struct1 { int a; int b; int c; string d; } STRUCT1; typedef struct struct2 {...
asked by 18.11.2016 / 00:44