Hi there,
i tried sumtyn like decompressing a4b7c2 in to aaaabbbbbbbcc...didnt worked...
i'm storing it in an array of big size and then trying to first shift b7c2 and
then expand a4..is it acceptable.. heres the code...the numbers i have assumed
to be single digit numbers in the original string.
int main()
{
char s[100]="a4b6c8";
int i,j,k,l;
l=strlen(s);
for(i=j=0; s[i]!='\0';i++)
{
if(s[i] >= 'a' && s[i] <= 'z')
s[j++]=s[i];
if(s[i] >= '0' && s[i] <= '9')
{
k = s[i]-48;
while(i<l)
{
s[l+(k-2)]=s[l];
l--;
}
s[l+(k-1)]='\0'; /*marking the new end of string*/
}
while((k-2)>0)
{/*some problem here may b*/
s[--j]=s[--i];
k--;
}
}
s[j]='\0';
printf("\n%s",s);
}
---------------------------------
Be a better Globetrotter. Get better travel answers from someone who knows.
Yahoo! Answers - Check it out.
[Non-text portions of this message have been removed]