i posted my program below. i aim making a decrypting file for rot13. or rotation 13 so im using the memory address to change the capital and small 'A' to 'M' into 'N' to 'Z' and vice versa by using their memory location. but i don't know how to put their memory location in my IF condition. pls help asap.
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main ()
{
string str[100];
string * strP;
string * strP2;
int i, size;
ifstream myfile;
myfile.open("PlainText.txt");
if (myfile.is_open())
{
size = myfile.gcount();
for (i=0;i<=size;i++)
{
strP=&str[i];
if (((strP>=0x41)&&(strP<=0x4D))||((strP>=0x61)&&(strP<=0x6D)))
{
strP2 = strP + 0x0D;
cout<<strP2;
}
else
{
if (((strP>=0x4E)&&(strP<=0x5A))||((strP>=0x6E)&&(strP<=0x7A)))
{
strP2 = strP - 0x0D;
cout<<strP2;
}
else cout<<*strP2;
}
}
myfile.close();
}
cout<<"Unable to open file!";
return 0;
}
your help will be much appreciated. tnx