Posts by Maik Catrinque • 48 points
3 posts
-
3
votes1
answer277
viewsQ: Knowing which class of daughter the parent class points to
I came from Java and I have a question about polymorphism in C++. Given these classes: class Empresa{ vector<Pessoa> pessoas; int empregados; addPessoa(Pessoa* p) } class Pessoa { ... }; class…
-
0
votes1
answer348
viewsA: C vector product with file input . dat
I just found that mistake: else if(i = N) Where it should surely be: else if(i == N)
-
0
votes1
answer60
viewsA: Error in vector size
The Error is in its main: struct produto *produtos[tamanho]; produtos[0] = (struct produto *) malloc ( tamanho * sizeof(struct produto)); It is not the correct way to allocate a struct vector. The…