Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int untag (char* str,int n);
- int main(int argc, char *argv[])
- {
- char* t=(char*)"<int> 45<\int>";
- int rv=untag(t,14);
- printf("\n%d",rv);
- }
- int untag (char* str, int n)
- {
- int i,j=0,k;
- char a[15];
- for (i=0;i<n;i++)
- {
- if (str[i]=='<')
- {
- while (str[i]!='>')
- i++;
- }
- else if (str[i]==' ')
- i++;
- else
- a[j++]=str[i];
- }
- a[j]=(char)0;
- //printf("%s",a);
- k=atoi(a);
- //printf("%d",k);
- return k;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement