Data Types in C Language

Data Types in C Language

The C language supports a wide variety of data types. These include:

  1. Primitive Data Types:

– Integer: char, int, short, long, long long

– Floating Point: float, double

– Boolean: _Bool

– Void

  1. Derived Data Types:

– Array: int array[10]

– Pointer: int *pointer

– Structure: struct student {…}

– Union: union data {…}

– Enumeration: enum color {…}

 

Data Types & Sizes

Data Type Size (in bytes) Description
char 1 Character type, stores a single character or ASCII code
int 4 Integer type, stores a whole number
float 4 Floating-point type, stores a decimal number with single precision
double 8 Floating-point type, stores a decimal number with double precision
short 2 Short integer type, stores a smaller whole number than int
long 8 Long integer type, stores a larger whole number than int
long long 8 Long long integer type, stores an even larger whole number than long
void N/A Void type, represents the absence of a value

List Of Keywords of C Language

Keyword Description
auto Defines a variable with automatic storage duration
break Terminates the current loop or switch statement
case Specifies a branch in a switch statement
char Declares a character data type
const Defines a variable as constant
continue Skips the current iteration of a loop
default Specifies the default branch in a switch statement
do Begins a do-while loop
double Declares a double-precision floating-point data type
else Specifies an alternative branch in an if statement
enum Declares an enumerated type
extern Declares a variable or function that is defined in another file
float Declares a floating-point data type
for Begins a for loop
goto Transfers control to a labeled statement
if Begins an if statement
int Declares an integer data type
Keyword Description
long Declares a long integer data type
register Defines a variable with register storage class
return Returns a value from a function
short Declares a short integer data type
signed Declares a signed data type
sizeof Returns the size of a data type or variable
static Defines a variable with static storage duration
struct Defines a structured data type
switch Begins a switch statement
typedef Defines a new data type
union Defines a union data type
unsigned Declares an unsigned data type
void Specifies that a function returns no value
volatile Declares a variable that can be modified by hardware or other processes
while Begins a while loop

Leave a Reply

Your email address will not be published. Required fields are marked *

https://atozonlinesolutions.com/wp-content/uploads/2017/03/logo_white.png
https://atozonlinesolutions.com/wp-content/uploads/2017/03/logo_white.png
About
Products
Subscribe

If you wish to receive our latest news in your email box, just subscribe to our newsletter. We won’t spam you, we promise!

    Applauz

    As the pioneer of the lean startup movement, APPLAUZ has dedicated it’s time to sharing effective business strategies that help new businesses and enterpreneurs put their money to work in the right way.

    Subscribe

    If you wish to receive our latest news in your email box, just subscribe to our newsletter. We won’t spam you, we promise!

      Applauz

      As the pioneer of the lean startup movement, APPLAUZ has dedicated it’s time to sharing effective business strategies that help new businesses and enterpreneurs put their money to work in the right way.

      Copyright by BOLD THEMES. All rights reserved.