Cypher function

Hi All! Newbie here in C++ programing and I need some help. I got a prototype:

char * crypt(const char *password, const char *salt)

I need to write the code but I can't figure out why I can't compile the program. I'm using Dev. Any help will be greatly appreciated. Thank you!


#define _XOPEN_SOURCE
#include <unistd.h>
#include <iostream.h>
#include <fstream.h>

int main()
{
char *password="adm1n";
char *salt="V37B22";
char *shadow;

char * crypt(const char *password, const char *salt); //prototype

shadow = crypt (&password, &salt); //call sending by reference...is this right?????

//cout << password << endl;
//cout << salt << endl;
cout << shadow << endl;

cout << "Enter key to quit!"
cin.get();
return 0;
}

How can I see the resulted encrypted shadow file? What should I cout?
Last edited on
cout << "Please hit the enter key to terminate the program!"
You're missing a semi-colon at the end of that line.


Also, you're using non-standard C++ code from over a decade ago. If your compiler is happy with it, throw it away and get a modern compiler for free. If you're using Dev-C++ V4.9.9.2 or earlier, please please stop using it. Every time you do, God kills a kitten.
I guess I missed that semicolon through copy and paste. I'm using Dev 4.9.9.2. What other free compilers are out there? Thank you,
http://www.cplusplus.com/forum/articles/36896/

Also, Dev-C++ is not a compiler. Many people use the terms IDE/compiler/linker interchangeably as if they're all the same thing. You'll get away with not knowing the difference until the time when you really do need to know the difference, and then you'll be stuck. Best to learn now what an IDE, compiler and linker actually are.
Last edited on
Topic archived. No new replies allowed.