Dev - C++ - me pueden decir porque me da estos errrores expliquenme

 
Vista:
sin imagen de perfil
Val: 34
Ha disminuido su posición en 2 puestos en Dev - C++ (en relación al último mes)
Gráfica de Dev - C++

me pueden decir porque me da estos errrores expliquenme

Publicado por carlos (35 intervenciones) el 03/04/2019 05:20:16
C:\Users\cuarto\Desktop\actividad 2\luacion 2.cpp In function 'int leer()':
29 7 C:\Users\cuarto\Desktop\actividad 2\luacion 2.cpp [Error] no match for 'operator>>' (operand types are 'std::istream {aka std::basic_istream<char>}' and 'std::string [15] {aka std::basic_string<char> [15]}')
29 7 C:\Users\cuarto\Desktop\actividad 2\luacion 2.cpp [Note] candidates are:
40 0 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\iostream In file included from C:/Program Files/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++/iostream
1 C:\Users\cuarto\Desktop\actividad 2\luacion 2.cpp from C:\Users\cuarto\Desktop\actividad 2\luacion 2.cpp
120 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::basic_istream<_CharT, _Traits>::__istream_type& (*)(std::basic_istream<_CharT, _Traits>::__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>]
120 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] no known conversion for argument 1 from 'std::string [15] {aka std::basic_string<char> [15]}' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&) {aka std::basic_istream<char>& (*)(std::basic_istream<char>&)}'
124 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::basic_istream<_CharT, _Traits>::__ios_type& (*)(std::basic_istream<_CharT, _Traits>::__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>; std::basic_istream<_CharT, _Traits>::__ios_type = std::basic_ios<char>]
124 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] no known conversion for argument 1 from 'std::string [15] {aka std::basic_string<char> [15]}' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&) {aka std::basic_ios<char>& (*)(std::basic_ios<char>&)}'
131 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>]
131 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] no known conversion for argument 1 from 'std::string [15] {aka std::basic_string<char> [15]}' to 'std::ios_base& (*)(std::ios_base&)'
168 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>]
168 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] no known conversion for argument 1 from 'std::string [15] {aka std::basic_string<char> [15]}' to 'bool&'
172 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]
172 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] no known conversion for argument 1 from 'std::string [15] {aka std::basic_string<char> [15]}' to 'short int&'
175 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>]
175 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] no known conversion for argument 1 from 'std::string [15] {aka std::basic_string<char> [15]}' to 'short unsigned int&'
179 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]
179 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] no known conversion for argument 1 from 'std::string [15] {aka std::basic_string<char> [15]}' to 'int&'
182 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>]
182 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] no known conversion for argument 1 from 'std::string [15] {aka std::basic_string<char> [15]}' to 'unsigned int&'
186 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>]
186 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] no known conversion for argument 1 from 'std::string [15] {aka std::basic_string<char> [15]}' to 'long int&'
190 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>]
190 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] no known conversion for argument 1 from 'std::string [15] {aka std::basic_string<char> [15]}' to 'long unsigned int&'
195 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>]
195 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] no known conversion for argument 1 from 'std::string [15] {aka std::basic_string<char> [15]}' to 'long long int&'
199 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>]
199 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] no known conversion for argument 1 from 'std::string [15] {aka std::basic_string<char> [15]}' to 'long long unsigned int&'
214 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>]
214 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] no known conversion for argument 1 from 'std::string [15] {aka std::basic_string<char> [15]}' to 'float&'
218 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>]
218 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] no known conversion for argument 1 from 'std::string [15] {aka std::basic_string<char> [15]}' to 'double&'
222 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>]
222 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] no known conversion for argument 1 from 'std::string [15] {aka std::basic_string<char> [15]}' to 'long double&'
235 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>]
235 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] no known conversion for argument 1 from 'std::string [15] {aka std::basic_string<char> [15]}' to 'void*&'
259 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(std::basic_istream<_CharT, _Traits>::__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__streambuf_type = std::basic_streambuf<char>]
259 7 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] no known conversion for argument 1 from 'std::string [15] {aka std::basic_string<char> [15]}' to 'std::basic_istream<char>::__streambuf_type* {aka std::basic_streambuf<char>*}'
53 0 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\string In file included from C:/Program Files/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++/string
40 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\bits\locale_classes.h from C:/Program Files/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++/bits/locale_classes.h
41 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\bits\ios_base.h from C:/Program Files/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++/bits/ios_base.h
42 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\ios from C:/Program Files/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++/ios
38 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\ostream from C:/Program Files/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++/ostream
39 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\iostream from C:/Program Files/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++/iostream
1 C:\Users\cuarto\Desktop\actividad 2\luacion 2.cpp from C:\Users\cuarto\Desktop\actividad 2\luacion 2.cpp
996 5 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\bits\basic_string.tcc [Note] template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::basic_string<_CharT, _Traits, _Alloc>&)
996 5 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\bits\basic_string.tcc [Note] template argument deduction/substitution failed:
29 17 C:\Users\cuarto\Desktop\actividad 2\luacion 2.cpp [Note] mismatched types 'std::basic_string<_CharT, _Traits, _Alloc>' and 'std::string [15] {aka std::basic_string<char> [15]}'
879 0 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream In file included from C:/Program Files/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++/istream
40 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\iostream from C:/Program Files/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++/iostream
1 C:\Users\cuarto\Desktop\actividad 2\luacion 2.cpp from C:\Users\cuarto\Desktop\actividad 2\luacion 2.cpp
955 5 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\bits\istream.tcc [Note] template<class _CharT2, class _Traits2> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT2*)
955 5 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\bits\istream.tcc [Note] template argument deduction/substitution failed:
29 17 C:\Users\cuarto\Desktop\actividad 2\luacion 2.cpp [Note] deduced conflicting types for parameter '_CharT2' ('char' and 'std::string {aka std::basic_string<char>}')
879 0 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream In file included from C:/Program Files/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++/istream
40 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\iostream from C:/Program Files/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++/iostream
1 C:\Users\cuarto\Desktop\actividad 2\luacion 2.cpp from C:\Users\cuarto\Desktop\actividad 2\luacion 2.cpp
923 5 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\bits\istream.tcc [Note] template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT&)
923 5 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\bits\istream.tcc [Note] template argument deduction/substitution failed:
29 17 C:\Users\cuarto\Desktop\actividad 2\luacion 2.cpp [Note] deduced conflicting types for parameter '_CharT' ('char' and 'std::string [15] {aka std::basic_string<char> [15]}')
40 0 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\iostream In file included from C:/Program Files/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++/iostream
1 C:\Users\cuarto\Desktop\actividad 2\luacion 2.cpp from C:\Users\cuarto\Desktop\actividad 2\luacion 2.cpp
727 5 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char&)
727 5 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] template argument deduction/substitution failed:
29 17 C:\Users\cuarto\Desktop\actividad 2\luacion 2.cpp [Note] cannot convert 'elec[i].barco::tipo_barco' (type 'std::string [15] {aka std::basic_string<char> [15]}') to type 'unsigned char&'
40 0 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\iostream In file included from C:/Program Files/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++/iostream
1 C:\Users\cuarto\Desktop\actividad 2\luacion 2.cpp from C:\Users\cuarto\Desktop\actividad 2\luacion 2.cpp
732 5 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char&)
732 5 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] template argument deduction/substitution failed:
29 17 C:\Users\cuarto\Desktop\actividad 2\luacion 2.cpp [Note] cannot convert 'elec[i].barco::tipo_barco' (type 'std::string [15] {aka std::basic_string<char> [15]}') to type 'signed char&'
40 0 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\iostream In file included from C:/Program Files/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++/iostream
1 C:\Users\cuarto\Desktop\actividad 2\luacion 2.cpp from C:\Users\cuarto\Desktop\actividad 2\luacion 2.cpp
774 5 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char*)
774 5 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] template argument deduction/substitution failed:
29 17 C:\Users\cuarto\Desktop\actividad 2\luacion 2.cpp [Note] cannot convert 'elec[i].barco::tipo_barco' (type 'std::string [15] {aka std::basic_string<char> [15]}') to type 'unsigned char*'
40 0 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\iostream In file included from C:/Program Files/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++/iostream
1 C:\Users\cuarto\Desktop\actividad 2\luacion 2.cpp from C:\Users\cuarto\Desktop\actividad 2\luacion 2.cpp
779 5 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char*)
779 5 C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\istream [Note] template argument deduction/substitution failed:
29 17 C:\Users\cuarto\Desktop\actividad 2\luacion 2.cpp [Note] cannot convert 'elec[i].barco::tipo_barco' (type 'std::string [15] {aka std::basic_string<char> [15]}') to type 'signed char*'




#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
using namespace std;
struct barco{

string tipo_barco[15];
string modelo[15];
string titular[20];
int ano;
int minuto;
int hora;
string ap;

};

int leer();
int mostrar();
int menu();
barco elec[4];

int leer()
{
for(int i=0; i<4; i++)
{

cout<<"introducir tipo de barco";
cin>>elec[i].tipo_barco;
cout<<elec[i].modelo;
cout<<"ano";
cin>>elec[i].ano;
cout<<"hora ";
cin>>elec[i].hora;
cout<<"minuto";
cin>>elec[i].minuto;
cout<<"pm o am";
cin>>elec[i].ap;
}
return 0;
}
int mostrar()
{
int i;
cout<<"tipo de barco"<<elec[i].tipo_barco;
cout<<"modelo"<<elec[i].modelo;
cout<<"ano"<<elec[i].ano;
cout<<"hora"<<elec[i].hora<<elec[i].minuto<<elec[i].ap;
return 0;
}

int menu()
{
int op;
system("cls");
cout<<"[1] leer datos";
cout<<"[2] mostrar datos";
cout<<"[3] salir";
cout<<"elija una opcion";
cin>>op;
return 0;
}
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de Alfil
Val: 1.674
Oro
Ha mantenido su posición en Dev - C++ (en relación al último mes)
Gráfica de Dev - C++

me pueden decir porque me da estos errrores expliquenme

Publicado por Alfil (443 intervenciones) el 03/04/2019 07:33:42
Fíjate en las diferencias, las bibliotecas, la declaración de string, no habías incluido un int main(), el switch, etc.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#include <iostream>
#include <cstdlib>
#include <string>
 
using namespace std;
 
struct barco{
 
    string tipo_barco;
    string modelo;
    string titular;
    int ano;
    int minuto;
    int hora;
    string ap;
 
};
 
void leer();
void mostrar();
int menu();
 
barco elec[4];
 
void leer()
{
    for( int i = 0; i < 4; i++ ) {
        cout << "\nIntroducir tipo de barco: ";
        cin >> elec[i].tipo_barco;
        cout << "Modelo: ";
        cin >> elec[i].modelo;
        cout << "Ano: ";
        cin >> elec[i].ano;
        cout << "Hora: ";
        cin >> elec[i].hora;
        cout << "Minutos: ";
        cin >> elec[i].minuto;
        cout << "pm o am: ";
        cin >> elec[i].ap;
    }
}
 
void mostrar()
{
 
    for( int i = 0; i < 4; i++ ) {
        cout << "\nTipo de barco: " << elec[i].tipo_barco;
        cout << "\nModelo: "<< elec[i].modelo;
        cout << "\nAno: " << elec[i].ano;
        cout << "\nHora: " << elec[i].hora << ":" << elec[i].minuto << elec[i].ap;
        cout << endl;
    }
}
 
int menu()
{
    int op;
 
    do{
        cout << "\n[1] leer datos";
        cout << "\n[2] mostrar datos";
        cout << "\n[3] salir";
        cout << "\nElija una opcion: ";
        cin >> op;
 
        switch ( op ) {
 
            case 1:
                leer();
                break;
            case 2:
                mostrar();
                break;
            case 3:
                break;
            default:
                cout << "\nOpcion incorrecta ";
                break;
        }
 
    }while( op != 3 );
}
 
int main()
{
    menu();
 
    return 0;
}
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar