strings are just a collection of numbers organized in a specific pattern such that each letter corrosponds to a particular number(see ASCII), your implementation is already flawed, you use letter offset's, but you don't account between caps/lower case letters, so, assuming that capitals would come after your lowercase letters, than H would be 26+7. i'm not sure what convention you want to use, but I don't see why you can't just use the ASCII system already in place, however if you do need to change the number representing the character then Cornstalk's already provided a pretty solid implementation of what to do.
I've been trying to work out how to convert strings to integers, ex "Hello world" should become "220.127.116.11.15 18.104.22.168.4". How would I do this? I dont want source code, I just want a basic explanation so I can figure out exactly how to use it. Thanks guys
There are allot of standard functions to convert data types. stringstream, itoa, atoi, etc..
But you could also write your own conversions..
stringstream takes average 2,000,000 ms to convert int <-> string
itoa and atoi takes average 350,000 ms to convert.
my convertions takes around 87,000ms for int to string. And around 43,000ms for string to int.
Meaning self written conversions are more effective, if good written. You are the programmer, you decide all the errorchecking.
I don't have a single check of wrong input to increase all performance. But I'm the only programmer at my projects so I know that I don't need to enter wrong input.
I truthfully hope you are either working with incredibly long strings/70's era processors, or that you simply meant micro-seconds(generally represented as 'mus' or 'us'), and not milliseconds, still, 2 seconds is a long time even for the standard library, so i'm not really sure what your doing.