Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/04/2011, 13:38
iovan
 
Fecha de Ingreso: septiembre-2007
Ubicación: PyRoot
Mensajes: 1.515
Antigüedad: 16 años, 7 meses
Puntos: 188
¿Que estoy haciendo mal al manejar esta funcion?

Amigo ssaammuu, si me pudieras ayudar otra vez ya me volvi a perder >.<


¿Que estoy haciendo mal?

Me dice: error C2065: 'resultado' : identificador no declarado


Código C++:
Ver original
  1. #include<stdio.h>
  2. #include<conio.h>
  3.  
  4. int octal(int num){
  5.    int resultado;
  6.    resultado = num%8;
  7.  
  8.    if(num>=8){
  9.        resultado+=10*octal(num/8);
  10.    }
  11.  
  12.    return resultado;
  13.  
  14. }
  15.  
  16. int main(){
  17.     int num;
  18.     printf("Indique un numero: "); scanf("%d",num);
  19.  
  20.     octal(num);
  21.  
  22.     printf("La respuesta es: ",resultado);
  23.     getch();
  24.  
  25. }

Gracias amigo.