plugin writing - need help with C

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> El Viernes, 13 de Abril de 2007, Simon Baxter escribi?:
>> My question is this.  I need to modify the channel sent, so that double
>> (or triple) channel numbers are sent as '6 3' or '1 1 7'  rather than
>> '63'
>> or '117'.  i.e. put spaces between the letters.
> You can try something like that:
>
>         char txt2[strlen(txt) * 2];
>         int i = 0;
>         int j = 0;
>         while (i < strlen(txt) - 1) {
>                 txt2[j] = txt[i];
>                 i++;
>                 j++;
>                 txt2[j] = ' ';
>                 j++;
>         }
>         txt2[j] = txt[i];
>         j++;
>         txt2[j] = '\0';
>

Thanks!

One more thing - how do I convert a %d variable to a %s string first?

My 'txt' variable is currently an integer.



[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux