Questions tagged as 'c++'

3
answers

Operation of const type variables

Let's see if someone can indicate to me, that I am misunderstanding, when it comes to understanding the concept const . I have an attribute of my class defined as follows: std::string name=""; //Inicialiazado Author::Author(const std...
asked by 25.04.2018 / 21:23
1
answer

Concatenate variables in C ++

I have a method that should return char* but I can not concatenate the variables: char* format(char* model){ char* format; format+=day+""; return format; } The variable day is type int , I come from java so I still...
asked by 31.08.2018 / 04:41
2
answers

Error dimensioning vectors in C ++

Greetings. It's my first time in forums, I'm learning C ++, and I have had a problem; I have to do a program that at first allows me to add student data to an arrangement. The problem is that it does not matter how many students you indica...
asked by 24.05.2017 / 20:09
2
answers

My code stops adding by converting from hexadecimal to decimal

I want to convert a string of 6 bytes in hexadecimal to a float float desencapsularArchivo::hex2dec(string aConvertir) { int cantHex = aConvertir.size(); float decimal = 0; for(int hexNum = 0;hexNum < cantHex; hexNum++)...
asked by 21.02.2018 / 19:38
2
answers

Problem with the Constructor (C ++ Error C2512, no appropriate default constructor available)

I need my constructor to start every element of my array in 0.0 , but with my code it tells me that: Error C2512 'Vendedor': no appropriate default constructor available". Annex the code: #pragma once #include <iostream> #i...
asked by 21.02.2016 / 05:35
1
answer

You doubt how the return works

I have a question, I've been going around for a few days, and I can not understand how it works or what I'm doing wrong. Starting point: Suppose we have the following function: ArrayWrapper f(ArrayWrapper arr){ return arr }...
asked by 25.05.2018 / 01:49
2
answers

Avoid unnecessary copies

I have an object that internally stores a rather heavy collection of objects. This collection is filled on demand, that is, if the collection is not necessary it will not be filled in life: class Objeto { std::vector<int> coleccion;...
asked by 30.08.2017 / 13:26
1
answer

If sequence? Recursivity?

I HIGHLIGHT THAT I'M JUST IN PR2 AND THERE ARE MANY THINGS THAT I STILL DO NOT, APOLOGIZE MY IGNORANCE (It has to be resolved with recursion) Good this is my code in which I try to solve the problem of the image above, which I do...
asked by 28.05.2016 / 02:17
2
answers

I can not print the string array on the screen

#include <iostream> #include <string> using namespace std; const int NUM = 3; void hola(string &mana[]) { mana[0] = "Hola soy sergio"; mana[1] = "Mamam me quierre"; mana[2] = "Hola como estas"; } int main() {...
asked by 09.03.2017 / 01:23
2
answers

How to delete a repeated character in C?

I am filling out a form with validations and there is a field that asks me for an average, and one of the rules to validate it is that it only contains one decimal point. Example: If the user types 2..2, ask the average question again....
asked by 12.04.2016 / 20:23