Questions tagged as 'c++'

1
answer

How do I send programming policy of the main program to any library?

I have a library that generates a result of two allowed. This is done by defining, within the library itself, the #define __SE8R01__ or #define __RF24L01P__ directive. The case is that this choice should be made within the main...
asked by 04.09.2017 / 18:15
1
answer

Data does not persist in switch case

Write a program that lists the names, height, weight, cpf, and sex of some people. With the data entered, then locate a person through your CPF and print your BMI. When I choose the Query option, the data that was entered before does not rema...
asked by 04.10.2017 / 04:39
1
answer

How to use template to specialize a function with type char *?

I'm doing C ++ exercises and I've created a template for the function to return the highest value. template<class Type> Type maximo (const Type a, const Type b) { if (a > b) { return a; } return b; Now the list...
asked by 21.09.2017 / 04:34
2
answers

Organization of projects with qMake

I'm developing a project and would like to start separating things into smaller parts and also to be able to test those parts, so by researching I found something about using * .pri files to be able to make a chain of projects and subprojects, b...
asked by 09.08.2017 / 18:21
1
answer

How to save records from a mysql query in C ++

I'm using a C ++ library that does the query in the database. My goal is to do a query, and save the data in a txt file, maybe even manipulating it to get json format. The problem is that I can not retrieve the value of the records when saving t...
asked by 04.08.2017 / 00:02
1
answer

How to count the total characters of a txt file, including spaces and '\ n'?

#include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char *argv[]) { FILE *arquivoRead; FILE *arquivoEscrita; char ch; int count=0; int lin, col; arquivoRead = fopen(argv[3]...
asked by 02.08.2017 / 16:41
1
answer

C ++: Data structure / Queue

I made a data structure algorithm. I put all my knowledge into it. I can not find the error. I leave the exercise statement below:    Make a program that creates two F1 and F2 queues, each one of size 10.   Read 20 integers, and if the number...
asked by 09.08.2017 / 03:38
1
answer

Error compiling C ++ source code together with header file and member function file

Hello, I would like some help with this exercise code. This is my first time trying to get a doubt here. When I try to compile the file with the GridBook.cpp member functions or the file containing the main function (_fig03_17.cpp_) is retu...
asked by 07.08.2017 / 21:28
1
answer

How to show image in OpenCV?

I would like to take a part of an image to play it in an array pass some kind of filter on it manually (without using the OpenCV functions) and show the result in a window to the user. For this I want to use only the imread functions to o...
asked by 17.07.2017 / 15:09
1
answer

C ++ Heterogeneous list

I've been looking for heterogeneous lists in% 1%, vector , array on the internet for weeks on c ++, but on all websites and forums the answer is the same: list , but I wanted a way to do in pure C ++. I developed this: #incl...
asked by 18.07.2017 / 20:33