# Questions tagged as 'vector'

1

## vector within vector generates duplicity of values in the second dimension

In the example below (which can also be seen in the Ideone ), I have vector of a class and within class I I have an element also vector . The point is that when doing push_back of the class, the internal vector vetint...
2

## 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 {...
1

## Lawtex - how to use logic based on the field of a Vector of structs?

I have a vector that uses a struct with several variables and one of them is a Boolean. What can I do to execute something if at least one element of that vector has this variable as true? struct[STR_Dados_dos_Inadimplentes] { fields {...
1

## How to put classes inside vector and manipulate variables with push_back?

It sure is something simple, but I researched and did not understand how to do. If I have, for example, the following class with two variables: class x { public: int var1, var2; }; I want to create a vector of this class, so I...
1

## How to access elements of a vector of a type defined by struct?

In my code, I made the following struct declaration: struct material { int idmaterial; double rho; double precokg; }; I wanted to run this function, which reads the data from a file: std::vector<material> le_material(std...
1

## Python, increasing number of numbers

My goal in the code is to print an increasing order of integers. For example: The user types 2 numbers and I want the growing order to be printed. Ex: n1 = int(input('Digite um número')) #O usuário digitou 9 n2 = int(input('Digite outro'))...
2

## Is it possible to assign the first column of a line of a / a vector / matrix?

having as example a vector of two dimensions of type char 2x2: char vet[2][2]; Is it possible to assign to the first line indices of this vector? or do they work like a pointer to the other rows and columns? I tried to do it as fo...
1

## Is it possible to create a std :: list with an initializer_list?

I'd like to pass a temporary std::list to a function, but I do not know if it's possible to do so. I know it is possible to pass% temporary% with std::vector : #include <iostream> #include <vector> template<typenam...
1

## Get result of an expression in c ++

I'm almost finishing my expression interpreter. But I have no idea how to do the most important part: The result I would learn a lot from any idea. main.cpp #include <string> #include <iostream> #include <fstream> #incl...
0

## What is the bubble short error in this code?

I tried to solve this problem of Online Judge URI and I got to this   code, and it works for test cases smaller than the problem, and   I already looked for the error, but I can not find it.   Code:#include<stdio.h>#include<stdl...