Ask your own question, for FREE!
Computer Science 18 Online
OpenStudy (anonymous):

I am having trouble getting a program to work. Essentially I want to use a keyword that that encypers a string that i enter Letter by letter so if I used "bacon" as my keyword and "Meet me at the park at eleven am " as the string to encyper. I want the output to be Negh zf av huf pcfx bt gzrwep oz. What i have written so far is #include #include #include #include // find asci to alphabetical then calculate the index value then move it then move it to ascii

OpenStudy (anonymous):

//get keyword in command line int main(int argc, char* argv[]) { //********************** test to see if int argc and char* argv were working correctly //printf("%s", argv[0]); //printf("%s\n\n\n", argv[1]); //****************************** //take string from argv and change use it to change chars printed in code printf("Type in words to encode"); string p = GetString(); string k = argv[1]; printf("%s", k);

OpenStudy (anonymous):

for(int i = 0, n = strlen(p), j= 0; i < n; i++, j++) { //q stands for quantity because n was taken // for(int j = 0, q = strlen(k); j < q; j++) //{ int c = (p[i] + k[j]); char test=p[i]; printf("%iXX %c", c, test); //} } return 0; }

OpenStudy (anonymous):

ALso sting is the same as char*

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!