c++ encryption and decryption source code
<p>i recently started learning c++ online and started working on this code but need some help with the errors the compiler is throwing on me.
basically i just want to get a password from the user if it is the first time by using 'flag' variable and write the password in an encrypted form onto a text file . 
if the user isn't logging in for the first time and has a password saved then read the encrypted text, de-crypt it and check wether it is equal to the password entered by the user.  </p>

<pre><code>#include&lt;iostream&gt;
#include&lt;string.h&gt;
#include&lt;fstream&gt;
using namespace std;
char encryptpass(char *pass) //function to encrypt 
 {

   for( int i=0; pass[i] != '\0'; ++i )
   char enpass[10]= ++pass[i];
   return(enpass);


}
 char decryptpass(char *str)  // function to decrypt
{
for( ; str!='\0'; ++str )
char depass[10]= --str;
return(depass);

}

 int main()             // main function
{
int flag=0;
if(flag=0)
{
    cout&lt;&lt;"enter your password";
    char pass[10];
    cin&gt;&gt;pass;
    fstream file("userpass.txt",ios::in | ios::out);
    file&lt;&lt;enpass[10];
}
else
{
  cout&lt;&lt;"enter password";
  cin&gt;&gt;pass;
   bool check=false;
   static char str[10];
   file.seekg(ios::beg);
   file &gt;&gt; str;
   file.close();
   decryptpass(str);

     if(pass=depass)   // decrypted password is equal to input password ?
   {
       check=true;      // set boolen value to true
   }
 else
 {
   cout&lt;&lt;"incorrect password";
 }
   return(0);
 }    // end of main
</code></pre>

<p>the compiler gives these errors-----</p>

<pre><code>warning : In function 'void encryptpass(char*)':
line 9 error: array must be initialized with a brace-enclosed initializer
line 9 warning: unused variable 'enpass' [-Wunused-variable]
line 10 error: 'enpass' was not declared in this scope
line 10 error: return-statement with a value, in function returning 'void' [-fpermissive]
warning : In function 'void decryptpass(char*)':
line 17error: array must be initialized with a brace-enclosed initializer
line 17 warning: unused variable 'depass' [-Wunused-variable]
line 18 error: 'depass' was not declared in this scope
line 18 error: return-statement with a value, in function returning 'void' [-fpermissive]
warning : In function 'int main()'
line 25 warning: suggest parentheses around assignment used as truth value [-Wparentheses]

line 31 error: 'enpass' was not declared in this scope
line 36 error: 'pass' was not declared in this scope
line 39 error: 'file' was not declared in this scope
line 43 error: 'depass' was not declared in this scope
</code></pre>