C-Programm zum Ermitteln der Größe einer Variablen (integerType, floatType, doubleType und charType)

C-Programm zum Ermitteln der Größe einer Variablen (integerType, floatType, doubleType und charType)

In diesem C-Programm lernen wir, wie man ein Programm schreibt, um die Größe einer Variablen (integerType, floatType, doubleType und charType) zu finden.

Hier ist der Code des Programms zum Ermitteln der Größe einer Variablen (integerType, floatType, doubleType und charType).

Code - C-Programm zum Ermitteln der Größe einer Variablen (integerType, floatType, doubleType und charType)
/*
C Program to Find the Size of a variable (integerType, floatType, doubleType and charType)
*/
#include <stdio.h>
int main()
{
    int integerType;
    float floatType;
    double doubleType;
    char charType;
    // Sizeof operator is used to evaluate the size of a variable
    printf("Size of int: %ld bytes\n",sizeof(integerType));
    printf("Size of float: %ld bytes\n",sizeof(floatType));
    printf("Size of double: %ld bytes\n",sizeof(doubleType));
    printf("Size of char: %ld byte\n",sizeof(charType));
    return 0;
}
Ausgabe

Größe von Int:4 Bytes
Größe von Float:4 Bytes
Größe von Double:8 Bytes
Größe von Char:1 Byte

--------------------------------
Prozess beendet nach 0,03805 Sekunden mit Rückgabewert 0
Press jede Taste, um fortzufahren. . .