The first thought I have is this should look like this...
1 2 3 4 5
char tin[17]= {0}; /// need to make one bigger than what you read in. 0-15 used and 16 is null.
fin.get(tin,16,EOF);
in=tin;
I think this will help, but not sure from what I read. the other thing that might be happening is note pad might not be showing you all the characters of the zeros in the text. I would have to write my own display routine for compensate for the nulls or char = 0
Line 53 and Line 63 bother me. If the files fail to open then there is no reason to continue the program. Please make a few changes:
1 2 3 4 5 6 7 8 9 10 11 12 13
/*ADD A DESTRUCTOR TO YOUR OBJECT TO HOLD THE APPLICATION OPEN*/
~CRYPT()
{
std::cin.sync();
std::cin.ignore();
}
/*CHANGE FILE INPUT CHECKS TO RETURN IF THE FILE DID NOT OPEN*/
if(!fin)
{
"\nfail open\n";
return 1;
}
EDIT: My first though about your OR encryption attempt is "Garbage In, Garbage Out". Where is your origional Text?
AppWizard has created this simple file crypt application for you.
This file contains a summary of what you will find in each of the files that
make up your simple file crypt application.
simple file crypt.vcproj
This is the main project file for VC++ projects generated using an Application Wizard.
It contains information about the version of Visual C++ that generated the file, and
information about the platforms, configurations, and project features selected with the
Application Wizard.
simple file crypt.cpp
This is the main application source file.
the encrypted output is
(it was pointed out that all the characters cannot be seen and copied from notepad....
is there any other method)
)&;
LE]
HH[
H L
<L
<
<HO
Kff; E
E
<E
L&OH
HL HHE
EL<
E H <f
E>O
]L& L
H&E & Abob[ H
H
<A<]eHEHE8E[L<
EO<] H L ]H3/GDH&
[H
L
L
H$<&
L8 ]BeHEHE%<O
E
O <L H
E
O>
O+NCE<E
L<
E CHfLOHE
O <L H&
@O
DE L
<O >
E E E
fOHEH$ H2
Fob[ H
H
<A&<oLLOH1 LE
L E
< E
>
E Ab
and the decrypted output is
AppWizard has created this simpile crypt application for you.
Ts file contains a summary of what you will find in eacof the fie up your simpl crypt apption.
simpl firypt.vcproj
This is the main project file for VC++ projects generatng an Appion Wizard.
It contains information about t version of Visua+ that ged the find
information about t prms, configurations, and projatures sd witthe
Application Wizard.
simpl firypt.cpp
Tthe main applicatisource fi
As for "another method" this is a valuable tool for a number of reasons including stuff like this: http://www.vim.org/download.php
"Garbage in garbage out" means that the guts of what ever you are doing (in this case your program) might be functioning %100, but if the input is nonsensical or somehow flawed then you won't get the results you are looking for.