Sunday, August 2, 2009

Code a program in ‘C’ to encrypt?

Using the method keyphrase replacement algorithm does any one know how to code a program in ‘C’ to encrypt a block of text from a file and save the encrypted data to another file?





I tried writing a program but got this error message:


c:\program files\miracle c\examples\steven_r\encrypt.c: line 35: ^ only for int


'{ count = count ^ *argv[3]'


aborting compile”

Code a program in ‘C’ to encrypt?
If you have a simple compile error, and you are unable to fix it, you are probably not keeping up in your course. Nevertheless, show us your code and maybe we can fix it up a little.





EDIT:


Your problem is that you're using arg[3] as if it was an integer which is not true, its actually a pointer to a string. If you want to convert it to an integer you'd have to do something like:





int x = atoi(*argv[3]);


No comments:

Post a Comment