Bit oder Bytes
-
Hallo eine dumme Frage -.-
Sind das da jetzt 3 Bit oder 3 Byte ich meine Bit oder ??
#include <iostream>
using namespace std;
int main()
{
char var[] = "abc";cout<< sizeof(var) << " bits lang ? oder bytes ";
system("PAUSE");
}
-
bytes
-
8 Bits sind (in quasi allen Fällen) 1 Byte.
-
Eigentlich laut Standard weder Bits noch Bytes, sondern ein Vielfaches von sizeof(char), denn das ist einfach als 1 definiert (egal ob ein char jetzt nur 1 Byte oder 4 Byte belegt).
Auf Intel/AMD-Platform (z.B. Windows und Linux) ist dies aber auch äquivalent mit Bytes (bzw. 8 Bits).