Questions tagged as 'c++'

4
answers

Error compiling "request for member 'size' in '* (int *) (& Dia)"

I have implemented a code for an enum that contains the days of the week, the problem that I get is with the function size() , I do not understand much the error, I tried to use a pointer to end() , but not I get nothing. Here is the...
asked by 13.10.2018 / 15:55
3
answers

Count repetitions of integers C ++, Array

Good morning, the exercise says the following "Design an algorithm that accepts a natural number n and counts the number of times each digit is repeated within it" I know I have not posted my code, but I do not know where to start, that is...
asked by 30.06.2017 / 22:46
1
answer

Query with algorithm for a [closed] problem

Good treatment to do the next problem . Here's my solution : #include <stdio.h> #include <bits/stdc++.h> using namespace std; #define MAX 10005 #define Node pair< int , int > #define INF 1<<30 struct cmp { boo...
asked by 15.06.2016 / 21:20
3
answers

Difference between structures and classes in C ++

What is the difference in C ++ between a structure and a class? According to what I understand, a structure is the way in c ++ to create an object, just as in python class is used.     
asked by 01.12.2016 / 21:59
4
answers

Is there a way to summarize all these else if?

Good, I'm with a project where a function checks if a ball touches a wall, which is an array of 15 "portions" with each 50u of size. I need to know what part of the wall it touches and for that I have done the following, but it is exaggeratedly...
asked by 14.04.2017 / 19:42
2
answers

Types listed c ++

The program tries that when entering a number from 0 to 6, it shows us the corresponding day of the week. However, it does not work due to the misuse of the listed types ( enum tElemento ). #include<iostream> #include<cstdlib>...
asked by 31.10.2017 / 14:35
2
answers

Statistical-logical problem with rand ()

I will start with an example: I have a box, of which you have 5 opportunities to take a ball, of these there are 4 types, red blue and green gold, the overall percentage (that is, per box) of taking one golden is 15%, red 15%, blue 30% and green...
asked by 12.10.2017 / 02:14
2
answers

c / c ++ - Use sizeof in a file

I'm trying to answer the question:    If you have a file declared "FILE * f;" the sizeof (f) function returns the size of the file. When loading data to the file I notice that the size is not updated therefore I conclude that it is False....
asked by 23.10.2017 / 19:32
3
answers

How to access an item within a list?

I am learning to use C ++ templates of stl and this library contains a class list<T> , I understand that it has functions similar to those of vector<T> (If not, please illustrate me) . My question is, how can...
asked by 25.05.2016 / 19:33
2
answers

Fix (not matrix) with double pointer in C ++

I do not understand how to handle an array with a double pointer (it's not a matrix, it's a linear array). I did some tests with the following code: int *num = new int; int** algo = &num;//acá se pasa por referencia (no por copia), el p...
asked by 23.03.2018 / 03:26