Guest User

Untitled

a guest
Jun 13th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.66 KB | None | 0 0
  1. 1
  2. 0
  3. First:Second
  4. Testing string!
  5. ---------------
  6. /**************
  7. * Author : karroje
  8. * Date : 2011-02-01
  9. * Purpose : Code provided for student to ensure that their
  10. * : Phase 01 code will correctly compile.
  11. * NOTE : This file does NOT comprehensivally test your code -- its only
  12. * : purpose to ensure that your code *compiles*. So long as you can
  13. * : compile your code with this file as main.cpp, the grader will
  14. * : be able to check for correctness. But it does not mean that your
  15. * : code is correct.
  16. **************/
  17.  
  18. #include "rsa_functions.h"
  19. #include "encrypt.h"
  20.  
  21. #include <iostream>
  22.  
  23. using namespace std;
  24.  
  25. int main() {
  26. char s1[] = "First";
  27. char s2[] = "Second";
  28.  
  29. cout << isLetter('a') << endl;
  30. cout << isUpper('b') << endl;
  31. char* d = concatStrings(s1, s2, ':');
  32. cout << d << endl;
  33.  
  34. char* t = "Testing string";
  35. char* s = (char*)malloc( (strlen(t) + 1)*sizeof(char));
  36. strncpy(s, t + '\0', strlen(t) +1);
  37. addChar(&s, '!');
  38.  
  39. cout << s << endl;
  40. int size;
  41. char* s3 = readFile("main.cpp", &size);
  42. cout << "---------------\n" << s3 << "\n---------------\n";
  43.  
  44. char* e = ceasarCipher(s3, size, 10);
  45. char* c = ceasarDecipher(e, size, 10);
  46. cout << "---------------\n" << c << "\n---------------\n";
  47.  
  48. return 0;
  49. }
  50.  
  51. ---------------
  52. ---------------
  53. /**************
  54. * Author : karroje
  55. * Date : 2011-02-01
  56. * Purpose : Code provided for student to ensure that their
  57. * : Phase 01 code will correctly compile.
  58. * NOTE : This file does NOT comprehensivally test your code -- its only
  59. * : purpose to ensure that your code *compiles*. So long as you can
  60. * : compile your code with this file as main.cpp, the grader will
  61. * : be able to check for correctness. But it does not mean that your
  62. * : code is correct.
  63. **************/
  64.  
  65. #include "rsa_functions.h"
  66. #include "encrypt.h"
  67.  
  68. #include <iostream>
  69.  
  70. using namespace std;
  71.  
  72. int main() {
  73. char s1[] = "First";
  74. char s2[] = "Second";
  75.  
  76. cout << isLetter('a') << endl;
  77. cout << isUpper('b') << endl;
  78. char* d = concatStrings(s1, s2, ':');
  79. cout << d << endl;
  80.  
  81. char* t = "Testing string";
  82. char* s = (char*)malloc( (strlen(t) + 1)*sizeof(char));
  83. strncpy(s, t + '\0', strlen(t) +1);
  84. addChar(&s, '!');
  85.  
  86. cout << s << endl;
  87. int size;
  88. char* s3 = readFile("main.cpp", &size);
  89. cout << "---------------\n" << s3 << "\n---------------\n";
  90.  
  91. char* e = ceasarCipher(s3, size, 10);
  92. char* c = ceasarDecipher(e, size, 10);
  93. cout << "---------------\n" << c << "\n---------------\n";
  94.  
  95. return 0;
  96. }
  97.  
  98. ---------------
  99. Press any key to continue . . .
Add Comment
Please, Sign In to add comment