Questions tagged as 'c++'

1
answer

List data from two tables in tableView

What do I do to list data from two tables in tableView? Database (Example) Sqlite: tb_venda tb_produto tb_valor tb_cliente_id (Id do cliente "tb_cliente") tb_cliente tb_cliente_id (id primary key) tb_nome tb_estado With...
asked by 04.07.2014 / 16:08
1
answer

How to sort a struct within a struct

I want to do sorting of a struct that is referenced inside another struct: Detail: can be sorted using selection sort typedef struct{ int tipo; char dispositivo[50]; int prioridade; }Perif; typedef struct no{ Perif info;...
asked by 06.06.2016 / 08:48
2
answers

How to limit a parameter of a function so that it is an element of a set?

My intention is to define a function that allows simulating the execution of a given deterministic finite automaton (DFA) . According to the formal definition a DFA is the 5-upla M = (Q, Σ, δ, q 0 , F) where: Q is the set of machine st...
asked by 04.04.2017 / 15:26
2
answers

Set position Cursor Windows & Linux with same code

I'm developing a cross-platform application. For this I would like to develop with as few as possible "ifdefs", and what I need to do is basically a 32 x 16 character fixed screen. But for me to have performance, I have the need to just re...
asked by 20.08.2015 / 23:00
2
answers

Problem notes and coins [closed]

The given question required that you use scanf to read a floating-point value from 0 to 1000000 and print out how many 100, 50, 20, 10, 5, and 2 real, and how many 1-real, 50, 25,10,5,1 cent would have the value inserted. The code is reading and...
asked by 14.10.2018 / 00:17
3
answers

C ++ - How to create a window in windows

I'm starting to program for windows using c ++ and the DevC ++ program. How do I create a common window?     
asked by 01.05.2018 / 13:46
1
answer

Update a TableView

How can I update a TableView after closing a Dialog? Example: main.ccp abre conexão com banco de dados principal::principal(){ //..etc..// model->setTable("nomeTabela"); model->setEditStrategy(QSqlTableModel::OnManualSubmit); m...
asked by 19.03.2014 / 14:08
4
answers

Is there a smaller way to solve the question below? and know if it's correct

Create an algorithm that contains a vector of integers. Then your algorithm should generate two more vectors. The first vector must store the numbers of the initial vector in ascending order and the second must store the values of the initial v...
asked by 17.09.2017 / 22:24
2
answers

How to concatenate two linked lists?

I created this code by initializing a list, however I need to improve it, creating a function that concatenates two and at the end print the value of the two concatenated ones ... That, I do not know how to do it. Suggested Prototype: no...
asked by 21.11.2014 / 15:52
2
answers

Problem with ternary operator

I'm having trouble with the ternary operator. I want to use it to make the code more elegant because it is a simple thing. But it's like it does not work because it does not update the variable. The following example depicts the problem: #incl...
asked by 12.01.2018 / 15:41