Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.87 KB | None | 0 0
  1. void ff(const int *ip) {
  2.     *ip = 3;
  3. }
  4.  
  5. int main()
  6. {
  7. // 1.
  8.     const int i;
  9.  
  10. // 2.
  11.     const int j = 10;
  12.     j++;
  13.  
  14. // 3.
  15.     const int l = 10;
  16.     int *p=&l;
  17.     (*p)++;
  18.  
  19. // 4.
  20.     extern void f(int *i);
  21.     const int iv = 100;
  22.     f(&iv);
  23.  
  24. // 5.
  25.     const int ivv = 100;
  26.     ff(&ivv);
  27.  
  28. // 6.
  29.     const int v[] = {1,2,3};
  30.     v[1]++;
  31.  
  32. // 7.
  33.     const int siz = 20;
  34.     int t[siz];
  35.  
  36. // 8.
  37.     char s1[] = "Hello konstans szoveg";
  38.     const char *pc = s1;
  39.     pc[0] = 'A';
  40.     pc++;
  41.  
  42. // 9.
  43.     char s2[] = "Hello konstans pointer";
  44.     char* const cp = s2;
  45.     cp[0] = 'B';
  46.     cp++;
  47.  
  48. // 10.
  49.     char s3[] = "Hello konstans szoveg konstans pointer";
  50.     const char* const cpc = s3;
  51.     cpc[0] = 'C';
  52.     cpc++;
  53.  
  54. // 11.
  55.     enum Szinek { tok, zold, makk, piros };
  56.     Szinek adu;
  57.     adu = 1;
  58.     adu = Szinek(10);
  59.  
  60.     return(0);
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement