Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. ISBN::ISBN(const char* str, const ISBNPrefix& list){ // Constructor With Arguements To Set The ISBN -
  2. // Back To It's Previous State.
  3. char s[11];
  4.  
  5. strcpy(isbn, str);
  6. int val;
  7. int a = 0;
  8. int b = 0;
  9. int c;
  10.  
  11. reg = decode(list);
  12. val = valid(str);
  13.  
  14. if(val == 1 && reg == 1){
  15.  
  16. mod[0] = '-';
  17. mod[1] = '\0';
  18. }
  19. else if(reg == 0){
  20.  
  21. for(c = 0; c < 5 && (isbn[c] != '\0'); c++){ // For Loop To Add Area Back To ISBN.
  22. area[c] = isbn[c];
  23. area[c + 1] = '\0';
  24. }
  25. for(c = (strlen(area) - 1); c < 7; c++){ // For Loop To Add Publisher Back To ISBN.
  26. publisher[b] = isbn[c];
  27. publisher[b + 1] = '\0';
  28. b++;
  29. }
  30. for(int c = ((strlen(area)) + (strlen(publisher))); c < 9; c++){ // For Loop To Add Title Back To ISBN.
  31. title[a] = isbn[c];
  32. title[a+1] = '\0';
  33. a++;
  34.  
  35. mod[0] = '\0';
  36. }
  37. }
  38. else{
  39.  
  40. *this = ISBN(); // Returns Current Object.
  41. }
  42.  
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement