Questions tagged as 'vector'

1
answer

Catch only equal elements in an array

I have an array for example: 1 4 7 1 3 4 6 7 1 2 3 4 5 6 I have to see the numbers that repeat on ALL lines, in the example, should be the numbers: 1 and 4. For they are repeating on all lines. Vector<Integer> validos = new Vector&l...
asked by 17.06.2016 / 17:23
3
answers

ANDROID - ERROR: Unchecked cast: java.lang.object to java.util.vector

I'm trying to fill a% city% according to the selected state in another spinner via spinner . But this is giving an error in this line in class webservice . Vector<SoapObject> resposta = (Vector<SoapObject>) en...
asked by 26.02.2016 / 15:09
1
answer

Problem with vector function in C ++

Hello, I'm trying to make a matrix calculator and my idea would be for the user to enter with the number of rows, columns and soon after with the array elements, the problem is that when I write the elements the program gives error of input strea...
asked by 02.06.2016 / 17:21
1
answer

Save excel file to an array

In the example below I have a class in java that will fetch data from a certain excel file. All this part of fetching the file the program does, but now needed that this data be stored in an array. I do not know how to do it. public class UniF...
asked by 26.10.2018 / 21:15
1
answer

Accessing methods of a class in a vector of pointers

Right, I have a Package class with a public method double calculate_cost (). I need to create a std::map<string, std::vector<Package*>> in which I can iterate through the vector and save the return of the calculate_cost () m...
asked by 05.10.2018 / 23:37
0
answers

Deleting a record of a vector vector in C ++

Hello, I have a memory allocation problem, I have a class and this class I generate a vector, but because there is a lot of data, I end up saving all of them and eventually I use them only once, I would like to know if it is possible to delete...
asked by 04.08.2018 / 00:15
1
answer

List with 3 elements c ++

I'm using list in c ++, and in what I think the structure of the inner one should contain:    Content   pointer to next element Is it possible to put one more variable within this structure, as the example below?    Content   variabl...
asked by 05.04.2018 / 19:04
1
answer

Failed to access vector option that does not exist

I did a few years ago an inheritance and polymorphism algorithm it is working properly but if I type 7 which is a nonexistent option on the menu it returns segmentation failure instead of returning nothing by printing the phrase, what's the prob...
asked by 18.01.2018 / 18:02
1
answer

Exercise Vectors, I'm stranded

It is intended to elaborate a program that asks integers to the user and saves them in a vector, this procedure is repeated until the user enters the value zero. At the end the program should show all the values that the user entered. You sho...
asked by 22.10.2017 / 14:47
1
answer

How to pass a vector of the vector class as parameter of a function?

The contents of my vector are the data I want to put in the array: int main() { vector<int> dados; int valores[4]; string val; ifstream arq ("matriz.txt"); if(arq.is_open()) { while(! arq.eof()) {...
asked by 30.09.2017 / 05:31