Created: 2023-01-10 15:39
Status: #concept
Subject: Programming
Tags: C Operators JavaScript Data Types TypeScript Types GraphQL Data Types

Data Types

int main(void) {
    // declares a variable named 'height' as an <int> data type.
	int height;
	// declares a variable named 'profit' as a 'float' data type with the value 1.1
	float profit = 1.1f;
}

Data Types in C.png
See also: Integer Float Character C String C Array struct Pointer

Custom Types with typedef

Using it causes the compiler to add a new Identifier to the list of type names that it recognizes in Variable declaration, C Type Conversion casting, etc.

they are not the same as Macro Definitions!

Syntax

typedef <data type> Name;

typedef int Bool;

Bool flag; // same as: "int flag;"

/* the compiler treats Bool as a synonym for int; flag is just an ordinary int */

References