You are on page 1of 2

Typedef in C

1 of 2

http://www.sitesbay.com/cprogramming/c-typedef

HOME

Get in Touch Java

Html

Html5

CSS

AWT

JavaScript

Collection

Ajax

JQuery

Jdbc

JSP

AngularJS

Servlet

JSON

SQL

GMaps

PL/SQL

Adsense

C-Code

C++-Code

Blogger

Earning

Java-Code

Email

Project

Domain

Interview

SEO

SMO

ABOUT | QUESTION | FORM S | CONTACT

Facebook Likes
Prev Tutorial

Next Tutorial

Advertisements

The C programming language provides a keyword called typedef, by using this keyword you can
create a user defined name for existing data type. Generally typedef are use to create an alias
name (nickname).
Basics of C Programming

C - Home
C - Overview of C
C - Features of C

typedef

datatype alias_name;

C - Applications of C
C - Installation of C
C - TC Editor
C - Source Vs Object Code

typedef

int Intdata;

C - Compiler
C - Comments
C - Keywords
C - Constant

#include<stdio.h>
#include<conio.h>

C - Variable
C - Variable Declaration
C - Scope of Variable
C - DataType
C - Data Type Modifiers
C - Operators
C - ++ and -- Operator
C - First C Program
C - Ternary Operator

typedef int Intdata; // Intdata is alias name of int


void main()
{
int a=10;
Integerdata b=20;
typedef Intdata Integerdata; // Integerdata is again alias name of Intdata
Integerdata s;
clrscr();
s=a+b;
printf("\n Sum:= %d",s);
getch();
}

C - sizeof Operator
C - Expression Evaluation
C - Storage Classes
C - Errors in C

Sum: 20

C - Structure of C Program
C - Main() Function
C - Printf() and Scanf()
C - Clrscr() and Getch()

In above program Intdata is an user defined name or alias name for an integer data
type.

C - Read & Write Character

All properties of the integer will be applied on Intdata also.


C Control Statements

Integerdata is an alias name to existing user defined name called Intdata.


C - Decision Making Statement
C - If Statement
C - if...else Statement
C - Switch Statement

Note: By using typedef only we can create the alias name and it is under control of compiler.
You can in another example, here myint is alias name for integer data and again smallint is alias
name for myint.

C - Looping Statement
C - While Loop
C - for Loop
C - do-while Loop
C - Break Statement

12/5/2016 2:34 PM

Typedef in C

2 of 2

http://www.sitesbay.com/cprogramming/c-typedef

C - Continue Statement

C Function
C - Function
C - Function Arguments
C - Recursion

One level up
C - Array
C - String

Prev Tutorial

Next Tutorial

C - Structure
Advertisements

C - Union
C - Enum
C - Pointer
C - Type Casting
C - Command Line Argument

Advance C Tutorials
C - Typedef
C - Buffer Concept
C - Preprocessor
C - Header Files
C - Compiling & Linking C
C - Dynamic Memory Allocation

File Handling
C - File Handling

Programming Tricks
Data Structure in C
Top 100 C Programs
C - Interview Question
Enable Graphics Library

Java

Tools

SEO

JDBC

Gigclerk

SMO

Servlet

Thesmartware

Email

JSP

Siteboostup

Adsense

Collection

SEOTool

Blogger

Interview

Androidappania

Earning

Email:

contact@sitesbay.com

Website:

www.sitesbay.com

Facebook:

www.facebook.com/Sitesbay

Copyright 2015-2016. All Rights Reserved @ Sitesbay.

About us | Privacy | Copyright | Feedback

12/5/2016 2:34 PM

You might also like