Questions tagged as 'vector'

1
answer

Variable return type

I want to do functions with type variant input, like this: int count(vector<auto> base, auto val) { int sum= 0; for (auto it : base) { if (it == val) { sum++; } } return sum; }...
asked by 24.06.2017 / 21:19
1
answer

Make SVG responsive

I can not manipulate the size of this hex, I would like it initially to have the size of 165x165px, and respectively make it responsive. I do not have much experience with SVG. <svg width="165" height="165"> <image xli...
asked by 21.07.2015 / 15:41
2
answers

Limit, or ability of a Vector

Imagine asking yourself "when the capacity reaches the limit you should warn the user" I have a vector of integers with 15 positions, and the user will enter values in there, the goal is to warn when it reaches the end, how? #include <stdio...
asked by 22.10.2017 / 15:41
0
answers

The handle function is not converting - matlab

Hello, I'm getting this error:    Conversion to function_handle from double is not possible. I already looked for the error and tried to change the code but without success. Can you help? A=[99.23;100.05;91;107.71;104.1]; B=[3441 344...
asked by 17.07.2017 / 13:02
1
answer

What is the usage limit of .push_back ()?

I often use .push_back(element) when working with vector , but I do not know what the maximum amount of elements I can add to a vector before it overflows and performs the reallocation of a new space in memory. Is there a...
asked by 01.11.2017 / 23:10
1
answer

Difference between vector of pointers for a class and vector for a class?

When is pointer to class will we have to allocate memory space? What is the difference between the following two statements and when should they be used? Vector <class*> nameOfVector; Vector <class> nameOfVector;     
asked by 15.12.2016 / 14:32
1
answer

Printing a vector ... Differences between C ++ and C ... Where did I go wrong?

I have problems in vector printing of structs in C, in C ++ it worked ... First I will show the C version with problems (in the execution since it compiles without errors) CACHE cache = createCache(descricao); //chamada da main printaCache...
asked by 18.11.2016 / 05:08
1
answer

Catch all elements that meet a condition

I have some Vector : public static Vector<Integer> id = new Vector<Integer>(); public static Vector<String> nome = new Vector<String>(); public static Vector<String> nascimento = new Vector<String>();...
asked by 15.06.2016 / 16:11
1
answer

Vectors - Separate negatives and positives

I have to make a program that receives a vector of 8 numbers and returns 2 vectors, the first with the positive numbers of the 8-position vector, and the second with the negative numbers. The problem is that I do not know how to use VECTOR, s...
asked by 16.06.2017 / 05:01
1
answer

"no overloaded function takes 0 arguments" when trying to insert into std :: vector

bunny is the default class that has only bunny(construtor) and ~bunny(desconstrutor) default. int main() { vector<bunny> bunnies; // Este usa o construtor padrão. bunnies.push_back(); // ERRO! est...
asked by 02.06.2016 / 19:44