Advertisement
WSTI

11d_4

Jan 5th, 2012
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. #include <string.h>
  4.  
  5. using namespace std;
  6.  
  7. /*
  8. napisać funkcję na modyfikującą tablicę elementów typu unsigned char zgodnie z regułą:
  9.      T[i]=255-T[i]
  10. */
  11.  
  12. void konwertuj(unsigned char *T)
  13. {
  14.      int i=0;
  15.      
  16.      while(T[i])
  17.      {
  18.                 T[i]=255-T[i];
  19.                 i++;
  20.      }
  21. }
  22.  
  23. int main ()
  24. {
  25.    unsigned char tekst[] = "Co ja kodze";
  26.    
  27.    konwertuj(tekst);
  28.    
  29.    cout << tekst;
  30.    
  31.   getch();  
  32.   return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement