Hey guys, i have been learning c++ for about some time and never had any problems as i could search them and find them, but this time i dont know what i am doing wrong :/
This is what i have coded so far:
#include <iostream>
#include <string.h>
using namespace std;
int main()
{
int opcion,contrasena;
cout << "Encripción de contraseña" << endl;
cout<<"Para Mostrar la contraseña ingrese 1"<<endl;
cout<<"Para Encriptar una contraseña ingrese 2"<<endl;
cin>>opcion;
if (opcion == 1){
//Clase que encripta la contraseña
class encriptar_contrasena
{
//Definicion de variables
string contrasena_sinencriptar;
float continuar, primera_ejecucion;
public:
//Valores de variables
continuar = 1;
primera_ejecucion = 1;
//Funciones
if (primera_ejecucion == 1)
{
cout<<"Ingrese la contraseña a encriptar"<<endl;
cout<<"La contraseña contiene "<<str.size()<< "Caracteres"<<endl;
cin >> contrasena_sinencriptar;
cout<<"Encriptando contraseña ...."<<endl;
}
};
}
}
It gives me the error Iso c++ forbids declaration of "continuar" with no type, even when i have seted it to be a float.
Help would be amaizing, thanks you guys!
There is something very wrong with your understanding of classes. A class cannot contain any executable code (as opposed to declarations) outside of its methods (or constructor or destructor or static functions) (I might be slightly generalizing here).
I suggest reading a tutorial on classes.