Questions tagged as 'c++'

1
answer

Is it possible to rewrite any code that uses pointers (C #) without using pointers in Node.js?

Is it possible to rewrite any C / C # code that uses pointers in a way that does the same thing without using them? My fear is more complex codes. The simple ones I believe do not have difficulties to rewrite. How could I replace pointers...
asked by 27.10.2018 / 08:46
0
answers

How to overload the + = operator so that an array of vectors can add another element to this vector?

I decided to redo some of a few workout codes I had done a long time ago, but I used the overload of operators, and I got into that problem: how could I overload the + = operator so that it executes analogously to the join method in the code bel...
asked by 21.12.2018 / 01:58
1
answer

Someone experienced that understands well the manipulation of Strings, that can help in this error

Good morning, I'm presenting a problem that I have no idea why, I've tried to ask other people, none have discovered the real reason for the error and how to fix it. Well my teacher, asked to implement a system with which opens a txt file that c...
asked by 13.11.2018 / 12:32
1
answer

Shuffle list in c ++

I want to know how I can, given a list, shuffle the order of the elements within it. The type structure of the list I want to shuffle is as follows. struct exemplo { int I; int O; int V; struct exemplo *prox; }     
asked by 17.07.2018 / 17:58
1
answer

I am trying to compare the word deposit with what the user will type, and if it is the same it will make the deposit

#include <stdio.h> #include <stdlib.h> #include <math.h> char nome[45], menu[45]; float saldo, valor; main(){ printf("Digite seu nome \n"); scanf("%s", &nome); printf("Digite o saldo \n"); scanf("%f", &...
asked by 20.04.2018 / 06:18
2
answers

Does my program only execute the first if?

I need to work out an algorithm that receives 3 real values and checks whether these values can be the lengths of the sides of a triangle, and in this case, return the type of triangle formed. So that x , y and z form a tr...
asked by 27.05.2018 / 05:26
1
answer

In the pairstring vector, int: When adding a new string, check if a future string has the same value as a string already added

And if you have, change the value of the previously added pair instead of adding a new pair. So, I would like to add string, int pairs into a vector, except that, to avoid redundant pairs, check if the string already exists and instead of add...
asked by 09.03.2018 / 00:47
1
answer

Copy string to struct

When trying to copy the String nome into the String in the Struct novo->nome the program stops working, if I comment the function strcpy(novo->nome,nome); the code executes normally. //Função de inserção: lista *inse...
asked by 11.08.2017 / 16:58
1
answer

Doubt in the use of the to_string function

In an exercise I'm doing, it was proposed to read two numbers, one integer and one real, and count how many digits they have. The input and output should look like this: Entre com o numero inteiro: 2345 Entre com o numero real: 234.549 O...
asked by 01.07.2018 / 19:53
1
answer

Verify that the elements of stack 1 are the same as elements of stack 2, C ++

Well done! I need to do this part of the code in C ++ comparing if the elements of Stack 1 are the same as Stack 2 and if the number of elements are exactly the same. I do not know how to implement this part of the code. I created the variable i...
asked by 12.09.2018 / 05:02