I want to use the crypt function in a program that I am making. I seem to be having troubles using it. Can someone point me in the right direction? (I have read the man crypt)
Thanks in advance. :confused:
Printable View
I want to use the crypt function in a program that I am making. I seem to be having troubles using it. Can someone point me in the right direction? (I have read the man crypt)
Thanks in advance. :confused:
Are you calling the external program properly?
Give us an example of the code you are using, so we can see what is going on.
#include <iostream>
#include <unistd.h>
test.cpp
-------------------
void main() {
char *salt="a9";
char *key="Secret";
cout << crypt(key, salt)) << endl;
exit(0);
}
]$ g++ -o test test.cpp
I was missing this: g++ -o test test.cpp -lcrypt. It works now :-) Thanks for your help.