Advertisement
dzieciol

wskazniki zadanie 3

Dec 3rd, 2015
419
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.41 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.  
  6. char napis[20];
  7.     int i,dl;
  8.     printf("Podaj napis ");
  9.     fgets(napis,20,stdin);
  10.     dl=strlen(napis)-1;
  11.  
  12.     for (i=0;i<=dl;i++)
  13.         printf("%c",napis[i]);
  14.  
  15.         //wskazniki iterowane
  16. for(i=0;i<=dl;i++)
  17.     printf("%c",*(napis+i));
  18.     //wskazniki zwykle
  19. char *wsk;
  20. wsk=&napis;
  21. i=0;
  22. while (i<=dl){
  23.     printf("%c",*(wsk+i));
  24. i++;
  25. }
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement