Questions tagged as 'c++'

1
answer

I do not identify the error - | 35 | error: 'd' undeclared (first use in this function) |

I'm programming in C / C ++ and gave an error that I can not identify it. #include <stdio.h> #include <stdlib.h> #include <stdbool.h> //Função Principal do Programa int main() { //Definindo variáveis int a = 5,...
asked by 10.07.2018 / 23:40
1
answer

counting how many days left to finish the year

I was doing a program in c ++ to count how many days left to finish the year from a date in the format dd / mm / yyyy but according to the date of the month that I enter it always gives the same result type: / p> If I enter 18/02/2018 or 12/02...
asked by 19.02.2018 / 13:02
2
answers

How to Randomize an Array in C ++

There is a lot of stuff here about array ordering methods (quicksort, bubblesort, etc.), but I was wondering if there is a method of "cluttering" arrays, that is, shuffling the array elements. > * There are even questions here on this topic, b...
asked by 15.05.2018 / 00:05
1
answer

Segmentation fault (core dumped) when accessing String

I've assembled the code below to separate only the last few characters of a link (the last 11 to be more exact). Until then everything works well, the calculations are done normally, the values also beat. The problem is at the time of giving...
asked by 09.01.2018 / 01:51
1
answer

Function with template

Someone can help me. I have to do the following function below.    Constructs a function to return the largest value among two numbers,   using template. The function should contain a maximum of two   parameters. Actual (actual) paramete...
asked by 15.09.2017 / 22:29
1
answer

This is valid (x = (* mat) ++;)?

(x = (*mat)++;) If it is valid, explain to me why and how it will work.     
asked by 10.09.2017 / 23:48
3
answers

How can this be improved? (it's just a little game)

I tried to make this game based on Magic Cards. As I'm still learning, that's how I managed to do it. I would like to see other versions to know how I could have done and what I did "wrong". #include <stdio.h> #include <stdlib.h> #...
asked by 11.09.2017 / 03:53
1
answer

Definition of classes

When I studied about defining a class it would look like this in the header: class Jogador { int id; std::string nome; int vida; void setNome(); std::string getNome(); } But I see a bit about unreal engine and I came ac...
asked by 17.04.2018 / 02:21
2
answers

Change return type

How do I change the return type of a parent class function in the child class? For example: class Mother { public: void Get() {} }; template <typename Type> class Child : public Mother { public: Type Get() { // TODO...
asked by 21.09.2017 / 03:14
1
answer

Functions with parameters in C language

I need help solving the following problem: "Write a function that gets an array of integers as a parameter and returns the index of the largest element of the array. I made a part of the code and it does what was requested, but not in the...
asked by 06.11.2017 / 10:11