Merci, on sait qu'un caractère = 1 octet (8 bits) et un mot mémoire = 32 bits, alors pour un caractère, c'est 1 octet. Je veux savoir pour une variable : ça peut être 1 ou 2 octets, ça dépend de cette variable, et pour un entier, c'est la même chose, est-ce que c'est juste ou non ? Merci d'avance.
it's unfortunately variable depending on the compiler and the platforms a char => from 1 to 2 bytes an integer => from 1 to 4 bytes, maybe 8 a float => from 4 to 10 bytes
some languages offer a sizeof() function. try to see on your compiler if such a feature exists.
printf("\nchar=%d int=%d double=%d float=%d\n", sizeof(char), sizeof(int), sizeof(double), sizeof(float));In C, everything is easy ;-)Good luck.