Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include<stdlib.h>
- #include <conio.h>
- #include <string.h>
- void odwrocenie (char *s) ;
- int main ()
- {
- char ciag_znakow[30] = "przypadkowy ciag znakow" ;
- odwrocenie(ciag_znakow) ;
- printf("ciag znakow po odwroceniu: %s\n", ciag_znakow);
- system ("pause") ;
- return 0;
- }
- void odwrocenie(char *s){
- //char *wsk = s + strlen(s)-1 ;
- char *wsk ;
- *wsk = s + strlen(s)-1 ;
- char temp;
- for (;wsk>s ; wsk--,s++) {
- temp = *s ;
- *s = *wsk ;
- *wsk = temp;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement