I need chars!

I'd like to make a mapping of strings to chars. I'm going to use a hard coded map in a program to compress data. Something like this:
a = "str1"
b = "str2"
etc..

Now the idea is to avoid making it by hand, so to speak. I got the strings, but I'm going to need 256 chars to map all. Is there a way of iterating chars so that there's no doubles? Oh, by the way are there even 256 chars..?

I don't clearly understand what you intend to do, but you can use a loop to iterate.

of course there are 256 charecters

you can try this

1
2
3
4
5
6
7
8
9
#include<iostream>

int main()
{
        unsigned char i=0;
        for(int j=0;j<=255;j++,i++)
             std::cout << i << std::endl;
        
}
Topic archived. No new replies allowed.