Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- #define size 80
- char* obrni(char* p, char novi[])
- {
- char *s=novi;
- int broj;
- while(*p!='\0')
- {
- if(*p>='0' && *p<='9')
- {
- broj=0;
- while(*p>='0' && *p<='9')
- {
- broj*=10;
- broj+=(int)(*p-'0');
- p++;
- }
- while(broj!=0)
- {
- *s=(char)(broj%10+'0');
- broj/=10;
- s++;
- }
- }
- *s++=*p++;
- }
- *s='\0';
- return novi;
- }
- int main()
- {
- char niz[50] = "Hrk255ljus789";
- char novi[50];
- char *p=novi;
- *p=obrni(niz, novi);
- while(*p!='\0')
- {
- printf("%c", *p++);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement