Voldemord

wskazniki

Dec 20th, 2018
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.53 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #define N 30
  4.  
  5. void wypisz(char *tab, int liczwyr)
  6. {
  7.     int i;
  8.     for(i=0; i<=liczwyr;i++)
  9.     {
  10.  
  11.         if(*tab != NULL)
  12.         {
  13.             printf("%d - %c\n",i,*tab);
  14.             *tab++;
  15.             *tab++;
  16.         }
  17.         else
  18.         {
  19.             printf("\n");
  20.             while(*tab == NULL)
  21.                 *tab++;
  22.         }
  23.  
  24.     }
  25. }
  26.  
  27. int main()
  28. {
  29.     char tab[][N] = {"hellows", "world", "abcde", "12345"};
  30.     char *p = tab;
  31.     wypisz(p, N);
  32.     return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment