Questions tagged as 'vector'

1
answer

push_back in Vector 2D, issuing error "no matching function for call"

I'm a beginner in C ++ programming, so I apologize in advance. As this question is answered here , you can use std::vector , 2D ( grid) with push_back() directly ( variavel[indice].push_back(...) ) incrementing unidimensio...
asked by 01.08.2017 / 04:35
1
answer

Read from a txt file using fscanf using vector

I have the following while(!feof(f)){ (*ptr).push_back(carro()); fscanf (f, "%d", (*ptr)[add].id); fscanf (f, "%s", (*ptr)[add].marca); add++; } Where * ptr is & vector, a vector of a struct car, I have alrea...
asked by 16.03.2017 / 21:24
1
answer

Problem in zeroing the score of a game

Well, I read Bjarne's book on programming and I'm learning programming there, I'm in chapter 5 that's about mistakes, at the end of the chapter there's a list of exercises for me to do, I came across an exercise in that I have to create a kind of...
asked by 17.01.2017 / 16:58
1
answer

How to use map / create keys to store cycles c / c ++?

What is the most efficient c / c ++ framework I can use to create and store cycles, so that I ensure that repeated cycles are not stored? I have a struct CYCLE, such that: struct CICLO { vector<Arco> rota; float COST; } struc...
asked by 27.03.2018 / 16:25
1
answer

Class Vector and random numbers in C ++

The function only returns the memory address, how do I get it to return the contents, not the memory address? #include <iostream> #include <time.h> /// por causa de srand() #include <stdlib.h> // para poder gerar os pesos...
asked by 23.06.2015 / 00:16
1
answer

vectordouble using ctypes for dll in python

I have a .dll inside it that has a BUBBLE function that returns a double. The problem is that BUBBLE has a vector<double> in the argument. extern "C" minhaDLL_API double BOLHA(vector<double> OI); In fact it has a ex...
asked by 10.04.2018 / 02:57
1
answer

Someone experienced that understands well the manipulation of Strings, that can help in this error

Good morning, I'm presenting a problem that I have no idea why, I've tried to ask other people, none have discovered the real reason for the error and how to fix it. Well my teacher, asked to implement a system with which opens a txt file that c...
asked by 13.11.2018 / 12:32