A C++ szabványban (draft) hol van benne a short, int, long méret alapján vett rangsor szabály? Egyszerűen nem találom
A sizeof(char) == sizeof(signed char) == sizeof(unsigned char) == 1 szabályt megtaláltam, de a short/long -ot egyszerűen nem. Rá is kerestem, de ígyse.
Vki nem tudja véletlenül? Nyilván nem oldalszámot várok hanem pl h meik fejezetben, stb..
Már megtaláltam.
ANSI C++03 3.9.1 2-3; azért köszönöm
ANSI C++ standard:
(2) There are four signed integer types: “signed char”, “short int”, “int”, and “long int.” In this list, each type provides at least as much storage as those preceding it in the list. Plain ints have the natural size suggested by the architecture of the execution environment) ; the other signed integer types are provided to meet special needs.
(3) For each of the signed integer types, there exists a corresponding (but different) unsigned integer type: “unsigned char”, “unsigned short int”, “unsigned int”, and “unsigned long int,” each of which occupies the same amount of storage and has the same alignment requirements (3.9) as the corresponding signed integer type) ; that is, each signed integer type has the same object representationas its corresponding unsigned integer type. The range of nonnegative values of a signed integer type is a subrange of the corresponding unsigned integer type, and the value representation of each corresponding signed/unsigned type shall be the same.
Kapcsolódó kérdések:
Minden jog fenntartva © 2024, www.gyakorikerdesek.hu
GYIK | Szabályzat | Jogi nyilatkozat | Adatvédelem | Cookie beállítások | WebMinute Kft. | Facebook | Kapcsolat: info(kukac)gyakorikerdesek.hu
Ha kifogással szeretne élni valamely tartalommal kapcsolatban, kérjük jelezze e-mailes elérhetőségünkön!