Author Topic: ANSI C, library for strings [strings++]  (Read 3335 times)

0 Members and 1 Guest are viewing this topic.

Offline kyllopardiun

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 178
  • Rating: +14/-4
  • Kyllopardiun over 2000 results in google.
    • View Profile
    • Kyllo's blog (a blog about poetry, videos and computing)
ANSI C, library for strings [strings++]
« on: October 20, 2010, 07:42:10 pm »
Actually this is my first C project of this kind,
and I hope it can be useful for someone here,

but, it's sad that you probably won't be able to use it in your calc...

Hope you enjoy!

/*

Maybe I can post a code as sample of usage
actually it's already done, just need to be translated

*/

So what it's this library for:

¤: replace the first occurrence of a char in a string [for a sub-string]

¤: replace every occurrence of a char in a string [for a sub-string]

¤: replace the first occurrence of sub-string in a string [for another sub-string]

¤: replace every occurrence of sub-string in a string [for another sub-string]


I know you could say why for if the last two can do the same of the first ones,
simply: they are MUCH FASTER than the 3rd and 4th ones.



They are listed in speed order ;)
« Last Edit: October 20, 2010, 08:40:23 pm by kyllopardiun »

Offline kyllopardiun

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 178
  • Rating: +14/-4
  • Kyllopardiun over 2000 results in google.
    • View Profile
    • Kyllo's blog (a blog about poetry, videos and computing)
Re: ANSI C, library for strings [strings++]
« Reply #1 on: October 21, 2010, 06:55:57 pm »
Well, sorry for double post. However without it I doubt anyone will ever read a edit here...

But, I want to hear if you have any comment about it [even if you think what I've done is useless]

and maybe some ideas about what you like, what could I improve...

Thanks for you attention,

;D

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: ANSI C, library for strings [strings++]
« Reply #2 on: October 21, 2010, 10:13:14 pm »
Unfortunately I don't do C much, so I can't really comment on it, but I wonder if this can be ported to calculators or if it's computer-dependent? It might have a bigger audience for calcs as a lot of people around here that code for computers mostly use C#, Python and Java.

Offline kyllopardiun

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 178
  • Rating: +14/-4
  • Kyllopardiun over 2000 results in google.
    • View Profile
    • Kyllo's blog (a blog about poetry, videos and computing)
Re: ANSI C, library for strings [strings++]
« Reply #3 on: October 21, 2010, 10:33:23 pm »
Unfortunately I don't do C much, so I can't really comment on it, but I wonder if this can be ported to calculators or if it's computer-dependent? It might have a bigger audience for calcs as a lot of people around here that code for computers mostly use C#, Python and Java.

I never programmed in C for a calc, but, if is calcs are ansi C compatible, then I would say it's very portable to a calc,
otherwise, I will need to write the ansi functions that I used here for a calc too.