elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Rompecabezas de Bitcoin, Medio millón USD en premios


  Mostrar Temas
Páginas: [1]
1  Programación / Programación C/C++ / Ayuda con este pequeño código de funciones logicas en: 11 Julio 2016, 19:43 pm
Estoy empezando en el C++ y estoy aprendiendo sobre funciones lógicas,
Necesito ayuda con este codigüito, Los errores dicen:
24   18   [Error] invalid conversion from 'char*' to 'char' [-fpermissive]
4   8   [Error] initializing argument 1 of 'bool vocal(char)' [-fpermissive]

El código es el siguiente:

#include<stdio.h>
#include<conio.h>

      bool vocal(char letra)
         {
         bool tipo;
         if(letra=='a' or letra=='e' or letra=='i' or letra=='o' or letra=='u')
         {
            tipo=true;
         }
         else
         {
            tipo=false;
         }
         return tipo;
         }
main()
{
   bool resp;
   char letra[1];
   printf("\nBienvenido ingrese un caracter: \n");
   scanf("%c",&letra);
   resp=vocal(letra);
   (resp==false)?printf("\n\tNo es una vocal"):printf("\n\t Es una vocal");
   
   
   getch();
}
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines