I've been trying to get this code to build, but I keep receiving the following errors:
week5Crook.obj : error LNK2019: unresolved external symbol "void __cdecl decrypt(char *)" (?decrypt@@YAXPAD@Z) referenced in function _main
week5Crook.obj : error LNK2019: unresolved external symbol "void __cdecl encrypt(char *)" (?encrypt@@YAXPAD@Z) referenced in function _main
Debug/week5Crook.exe : fatal error LNK1120: 2 unresolved externals
The program compiles fine and I haven't been able to figure out exactly what this error is trying to tell me. I was able to build and run this program in Dev C++, but I'm now getting these errors when I try to build this program in VS .Net 2003. Any guidance you may be able to provide would be greatly appreciated.
#include <iostream>
using namespace std;
void encrypt(char *);
void decrypt(char *);
int main()
{
char string[] = "This is a secret!";
cout << "Encrypted string is: ";
encrypt(string);
cout << "\nDecrypted string is: ";
decrypt(string);
cout << endl << endl;
return 0;
}//end main()
//encrypts string by adding 1 to the value of each character
void encrypt(char *sPtr)
{
while (*sPtr != '\0') //exit while at null character
{
*sPtr += 1;
cout << *sPtr;
++sPtr;
}//end while
}//end encrypt()
//decrypts string by subtracting 1 to the value of each character
void decrypt(char *sPtr)
{
while (*sPtr != '\0')//exit while at null character
{
*sPtr -= 1;
cout << *sPtr;
++sPtr;
}//end while
}//end decrypt()