i want to know about characterset in C.

Recommended Answers

All 2 Replies

Every compiler has 2 character sets, the source/compiler character set, that is the character set the compiler uses to read the source files and the execution character set, that is the character set that the produced program will use while it is running.

Apart from that the C standard doesn't have much to say, about the only guarantee it makes is that for the digits '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' the result of subtracting a digit character from another should be the result subtracting the number from the other i.e.

'2' - '1' = 2 - 1 = 1

It does not make this type of guarantee for any other characters, for instance letters.

Apart from that any implementation is free to use any character set it chooses.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.