Questions tagged as 'c++'

2
answers

select option c ++

How can I make the user select an option? ----- Menu ------ read open close I have this, but it does not work: char menu; cin>>menu; while(menu != 'l' && menu != 'a' && menu != 'c'){ cin>>opcion...
asked by 30.12.2017 / 18:57
1
answer

How can I make an error-proof switch?

When I make a switch I usually have the worry that someone will introduce an unexpected value such as a letter or a special character, my question is: How can I force the program to only receive what is expected? I had heard that it can be done...
asked by 25.09.2017 / 21:34
2
answers

Error calling functions

The program consists of hitting the lottery and then hitting another prize. The problem is when declaring the congratulations function (). When I call this from the main it gives me an error and if I call it at the end of the lottery () funct...
asked by 09.11.2017 / 13:33
1
answer

Error defining the methods of a class

I have this date.h , where I have a class Date . I define my methods and then implement them in a date.cpp but the compiler throws me errors of:    error: "method ...." previously defined here. and error: redefinition of "m...
asked by 02.09.2017 / 03:49
3
answers

C ++ Program that adds and removes the media with FOR

I have to introduce the FOR structure and modify this existing code, but no matter how much I turn over the question I can not understand what it refers to. #include <iostream> using namespace std; void main(){ float Jordi, Pascual,...
asked by 15.10.2018 / 20:11
1
answer

Function that returns a list

I am new programming in c ++; So far I have programmed in visual basic.e get in state of 4 analog inputs and save them in a list EA={"","","",""} . But when I want the function to return that list ( return EA; ) it gives me an error....
asked by 03.07.2017 / 09:31
1
answer

Read a .txt file and match it to a string

What I did in Linux to load the program to the console, only with a command in the terminal: ./s < EjemplosSudoku.txt in windows is not possible, and I assume that you have to load it from the same code, calling the .txt file. Could s...
asked by 04.06.2017 / 15:45
2
answers

Adjust text to align

In a project I have to show the following on the screen: La Jornada con mas puntos es la 5 con 344 puntos. > Jornada 5 ----------------------------------------- R._Madrid 84 - 91 Barcelona Manresa 84 - 85 Joventut The problem is that I...
asked by 04.04.2017 / 15:52
2
answers

How to Modify Data Stored in a Vector C ++

Good Night, because the next thing is that I do not know how to do to be able to modify the data that is stored in a vector. In my program I ask for the data of workers (Name and Cedula). Then in the end what I want is to Achieve Modify, from ex...
asked by 28.04.2017 / 01:59
3
answers

Clear variable when re-entering the for c ++

Good, how to clean the variables of hour, minutes, and seconds at the end of for to start me in 0 ? thank you I leave my code #include<iostream> #include<conio2.h> #include<stdlib.h> using namespace std; main ()...
asked by 07.04.2017 / 18:18