Questions tagged as 'c++'

1
answer

Execute commands in a string in C ++

I have commands in a string something like: string comm = "int x; cout << \"Digite um número\"; cin << x;"; My idea is to execute the commands that are in this string , having the result as if I had typed: int x cout <&l...
asked by 16.07.2017 / 02:47
1
answer

Pointer to pointer array

I would like to know if in the code below (the variable 'p') is a Pointer to a Pointer Array? #include <stdio.h> int main () { double valor = 7; double *balance[5] = {&valor, &valor, &valor, &valor, &valor}; double...
asked by 30.05.2017 / 20:54
1
answer

Double-chained Circular List in C / C ++

I'm having trouble removing the first and last elements of this circular list. // Created by Thiago Cunha on 25/05/2017. // #include "double_linked_list_circular.h" int count = 0; List* init() { return NULL; } List* insertInit(List* li...
asked by 30.05.2017 / 15:24
1
answer

Problems with dynamic and struct allocation

I want to create a struct where there will be a vector of structs ... The way I thought about doing this was something like this: typedef struct{ char *teste_str; int teste_int; }TESTE_A; typedef struct{ TESTE_A **t;...
asked by 21.05.2017 / 15:33
1
answer

system () function does not accept string variable in c ++

In order to automate some backups that need to be done routinely, then I thought of using an app in dos to do, however I'm having problems compiling the executable because it seems to me that the function system() only accepts cha...
asked by 10.05.2017 / 20:34
1
answer

What is the purpose of the compare function of the qsort function of C ++?

Below is an example of the application of the qsort function, using a compare function: #include <iostream> #include <cstdlib> #include <climits> using namespace std; int compare (const void * a, const void *...
asked by 10.05.2017 / 01:40
1
answer

Doubt over iteration with multiple parameters

This loop realizes Log_base_2 of an integer value, at the end the result is available in the variable i . Why does a shift of the form valor >> 1 have no effect compared to valor = valor >> 1 which by the way...
asked by 29.04.2017 / 04:30
1
answer

How can I pass a file descriptor to another process?

I recently read a Peter Hutterer post explaining about a new protocol called inputfd that is intended to forward a file descriptor directly to other processes without the composer's interaction. I was curious, how is it possible to pass a f...
asked by 17.04.2017 / 20:10
1
answer

Accessing a pointer pointer (c)

Why when dropping a level on the pointer pointer ** lista / * lista we should use the parentheses: ( * lista ) , I ask the question because I saw in some internet examples that they did not use and also in an old book that I...
asked by 17.04.2017 / 23:04
1
answer

C ++: Vector in a function

I'm doing a project where I use many vector-type vectors. But working with array vectors is easier, so I did the following function: // add.cpp vector <string> sAdd (string In[]) { vector <string> Out; Out.resize (sizeof(In))...
asked by 24.04.2017 / 03:47