Exercise-1 : “integer modifier and qualifier” combinations

  • Check if below combination of modifiers, qualifiers are allowed in different contexts as depicted in the table

Combination

sizeof()

Local variables

Global variables

Function parameters

Function return type

Inside structure

Inside union

int a;

auto int a;

register int a;

static int a;

extern int a;

typedef int a;

short int a;

long int a;

signed int a;

unsigned int a;

const int a;

volatile int a;

auto register int a;

auto static int a;

auto extern int a;

auto typedef int a;

register auto int a;

register static int a;

register extern int a;

register typedef int a;

static auto int a;

static register int a;

static extern int a;

static typedef int a;

extern auto int a;

extern register int a;

extern static int a;

extern typedef int a;

typedef auto int a;

typedef register int a;

typedef static int a;

typedef extern int a;

auto short int a;

auto long int a;

auto signed int a;

auto unsigned int a;

register short int a;

register long int a;

register signed int a;

register unsigned int a;

static short int a;

static long int a;

static signed int a;

static unsigned int a;

extern short int a;

extern long int a;

extern signed int a;

extern unsigned int a;

typedef short int a;

typedef long int a;

typedef signed int a;

typedef unsigned int a;

auto const int a;

auto volatile int a;

register const int a;

register volatile int a;

static const int a;

static volatile int a;

extern const int a;

extern volatile int a;

typedef const int a;

typedef volatile int a;

short const int a;

short volatile int a;

long const int a;

long volatile int a;

signed const int a;

signed volatile int a;

unsigned const int a;

unsigned volatile int a;

auto short const int a;

auto short volatile int a;

auto long const int a;

auto long volatile int a;

auto signed const int a;

auto signed volatile int a;

auto unsigned const int a;

auto unsigned volatile int a;

register short const int a;

register short volatile int a;

register long const int a;

register long volatile int a;

register signed const int a;

register signed volatile int a;

register unsigned const int a;

register unsigned volatile int a;

static short const int a;

static short volatile int a;

static long const int a;

static long volatile int a;

static signed const int a;

static signed volatile int a;

static unsigned const int a;

static unsigned volatile int a;

extern short const int a;

extern short volatile int a;

extern long const int a;

extern long volatile int a;

extern signed const int a;

extern signed volatile int a;

extern unsigned const int a;

extern unsigned volatile int a;

typedef short const int a;

typedef short volatile int a;

typedef long const int a;

typedef long volatile int a;

typedef signed const int a;

typedef signed volatile int a;

typedef unsigned const int a;

typedef unsigned volatile int a;

int *a;

auto int *a;

register int *a;

static int *a;

extern int *a;

typedef int *a;

short int *a;

long int *a;

signed int *a;

unsigned int *a;

const int *a;

volatile int *a;

auto register int *a;

auto static int *a;

auto extern int *a;

auto typedef int *a;

register auto int *a;

register static int *a;

register extern int *a;

register typedef int *a;

static auto int *a;

static register int *a;

static extern int *a;

static typedef int *a;

extern auto int *a;

extern register int *a;

extern static int *a;

extern typedef int *a;

typedef auto int *a;

typedef register int *a;

typedef static int *a;

typedef extern int *a;

auto short int *a;

auto long int *a;

auto signed int *a;

auto unsigned int *a;

register short int *a;

register long int *a;

register signed int *a;

register unsigned int *a;

static short int *a;

static long int *a;

static signed int *a;

static unsigned int *a;

extern short int *a;

extern long int *a;

extern signed int *a;

extern unsigned int *a;

typedef short int * a;

typedef long int * a;

typedef signed int * a;

typedef unsigned int * a;

auto const int *a;

auto volatile int *a;

register const int *a;

register volatile int *a;

static const int *a;

static volatile int *a;

extern const int *a;

extern volatile int *a;

typedef const int *a;

typedef volatile int *a;

short const int *a;

short volatile int *a;

long const int *a;

long volatile int *a;

signed const int *a;

signed volatile int *a;

unsigned const int *a;

unsigned volatile int *a;

auto short const int *a;

auto short volatile int *a;

auto long const int *a;

auto long volatile int *a;

auto signed const int *a;

auto signed volatile int *a;

auto unsigned const int *a;

auto unsigned volatile int *a;

register short const int *a;

register short volatile int *a;

register long const int *a;

register long volatile int *a;

register signed const int *a;

register signed const int *a;

register signed const int *a;

register signed const int *a;

static short const int *a;

static short volatile int *a;

static long const int *a;

static long volatile int *a;

static signed const int *a;

static signed volatile int *a;

static unsigned const int *a;

static unsigned volatile int *a;

extern short const int *a;

extern short volatile int *a;

extern long const int *a;

extern long volatile int *a;

extern signed const int *a;

extern signed volatile int *a;

extern unsigned const int *a;

extern unsigned volatile int *a;

typedef short const int *a;

typedef short volatile int *a;

typedef long const int *a;

typedef long volatile int *a;

typedef signed const int *a;

typedef signed volatile int *a;

typedef unsigned const int *a;

typedef unsigned volatile int *a;

int a[10];

auto int a[10];

register int a[10];

static int a[10];

extern int a[10];

typedef int a[10];

short int a[10];

long int a[10];

signed int a[10];

unsigned int a[10];

const int a[10];

volatile int a[10];

auto register int a[10];

auto static int a[10];

auto extern int a[10];

auto typedef int a[10];

register auto int a[10];

register static int a[10];

register extern int a[10];

register typedef int a[10];

static auto int a[10];

static register int a[10];

static extern int a[10];

static typedef int a[10];

extern auto int a[10];

extern register int a[10];

extern static int a[10];

extern typedef int a[10];

typedef auto int a[10];

typedef register int a[10];

typedef static int a[10];

typedef extern int a[10];

auto short int a[10];

auto long int a[10];

auto signed int a[10];

auto unsigned int a[10];

register short int a[10];

register long int a[10];

register signed int a[10];

register unsigned int a[10];

static short int a[10];

static long int a[10];

static signed int a[10];

static unsigned int a[10];

extern short int a[10];

extern long int a[10];

extern signed int a[10];

extern unsigned int a[10];

typedef short int a[10];

typedef long int a[10];

typedef signed int a[10];

typedef unsigned int a[10];

auto const int a[10];

auto volatile int a[10];

register const int a[10];

register volatile int a[10];

static const int a[10];

static volatile int a[10];

extern const int a[10];

extern volatile int a[10];

typedef const int a[10];

typedef volatile int a[10];

short const int a[10];

short volatile int a[10];

long const int a[10];

long volatile int a[10];

signed const int a[10];

signed volatile int a[10];

unsigned const int a[10];

unsigned volatile int a[10];

auto short const int a[10];

auto short volatile int a[10];

auto long const int a[10];

auto long volatile int a[10];

auto signed const int a[10];

auto signed volatile int a[10];

auto unsigned const int a[10];

auto unsigned volatile int a[10];

register short const int a[10];

register short volatile int a[10];

register short volatile int a[10];

register short volatile int a[10];

register short volatile int a[10];

register short volatile int a[10];

register short volatile int a[10];

register short volatile int a[10];

static short const int a[10];

static short volatile int a[10];

static long const int a[10];

static long volatile int a[10];

static signed const int a[10];

static signed volatile int a[10];

static unsigned const int a[10];

static unsigned volatile int a[10];

extern short const int a[10];

extern short volatile int a[10];

extern long const int a[10];

extern long volatile int a[10];

extern signed const int a[10];

extern signed volatile int a[10];

extern unsigned const int a[10];

extern unsigned volatile int a[10];

typedef short const int a[10];

typedef short volatile int a[10];

typedef long const int a[10];

typedef long volatile int a[10];

typedef signed const int a[10];

typedef signed volatile int a[10];

typedef unsigned const int a[10];

typedef unsigned volatile int a[10];

int **a;

auto int **a;

register int **a;

static int **a;

extern int **a;

typedef int **a;

short int **a;

long int **a;

signed int **a;

unsigned int **a;

const int **a;

volatile int **a;

auto register int **a;

auto static int **a;

auto extern int **a;

auto typedef int **a;

register auto int **a;

register static int **a;

register extern int **a;

register typedef int **a;

static auto int **a;

static register int **a;

static extern int **a;

static typedef int **a;

extern auto int **a;

extern register int **a;

extern static int **a;

extern typedef int **a;

typedef auto int **a;

typedef register int **a;

typedef static int **a;

typedef extern int **a;

auto short int **a;

auto long int **a;

auto signed int **a;

auto unsigned int **a;

register short int **a;

register long int **a;

register signed int **a;

register unsigned int **a;

static short int **a;

static long int **a;

static signed int **a;

static unsigned int **a;

extern short int **a;

extern long int **a;

extern signed int **a;

extern unsigned int **a;

typedef short int **a;

typedef long int **a;

typedef signed int **a;

typedef unsigned int **a;

auto const int **a

auto volatile int **a;

register const int **a

register volatile int **a;

static const int **a

static volatile int **a;

extern const int **a

extern volatile int **a;

typedef const int **a

typedef volatile int **a;

short const int **a;

short volatile int **a;

long const int **a;

long volatile int **a;

signed const int **a;

signed volatile int **a;

unsigned const int **a;

unsigned volatile int **a;

auto short const int **a;

auto short volatile int **a;

auto long const int **a;

auto long volatile int **a;

auto signed const int **a;

auto signed volatile int **a;

auto unsigned const int **a;

auto unsigned volatile int **a;

register short const int **a;

register short volatile int **a;

register long const int **a;

register long volatile int **a;

register signed const int **a;

register signed volatile int **a;

register unsigned const int **a;

register unsigned volatile int **a;

static short const int **a;

static short volatile int **a;

static long const int **a;

static long volatile int **a;

static signed const int **a;

static signed volatile int **a;

static unsigned const int **a;

static unsigned volatile int **a;

extern short const int **a;

extern short volatile int **a;

extern long const int **a;

extern long volatile int **a;

extern signed const int **a;

extern signed volatile int **a;

extern unsigned const int **a;

extern unsigned volatile int **a;

typedef short const int **a;

typedef short volatile int **a;

typedef long const int **a;

typedef long volatile int **a;

typedef signed const int **a;

typedef signed volatile int **a;

typedef unsigned const int **a;

typedef unsigned volatile int **a;

int a[10][10];

auto int a[10][10];

register int a[10][10];

static int a[10][10];

extern int a[10][10];

typedef int a[10][10];

short int a[10][10];

long int a[10][10];

signed int a[10][10];

unsigned int a[10][10];

const int a[10][10];

volatile int a[10][10];

auto register int a[10][10];

auto static int a[10][10];

auto extern int a[10][10];

auto typedef int a[10][10];

register auto int a[10][10];

register static int a[10][10];

register extern int a[10][10];

register typedef int a[10][10];

static auto int a[10][10];

static register int a[10][10];

static extern int a[10][10];

static typedef int a[10][10];

extern auto int a[10][10];

extern register int a[10][10];

extern static int a[10][10];

extern typedef int a[10][10];

typedef auto int a[10][10];

typedef register int a[10][10];

typedef static int a[10][10];

typedef extern int a[10][10];

auto short int a[10][10];

auto long int a[10][10];

auto signed int a[10][10];

auto unsigned int a[10][10];

register short int a[10][10];

register long int a[10][10];

register signed int a[10][10];

register unsigned int a[10][10];

static short int a[10][10];

static long int a[10][10];

static signed int a[10][10];

static unsigned int a[10][10];

extern short int a[10][10];

extern long int a[10][10];

extern signed int a[10][10];

extern unsigned int a[10][10];

typedef short int a[10][10];

typedef long int a[10][10];

typedef signed int a[10][10];

typedef unsigned int a[10][10];

auto const int a[10][10];

auto volatile int a[10][10];

register const int a[10][10];

register volatile int a[10][10];

static const int a[10][10];

static volatile int a[10][10];

extern const int a[10][10];

extern volatile int a[10][10];

typedef const int a[10][10];

typedef volatile int a[10][10];

short const int a[10][10];

short volatile int a[10][10];

long const int a[10][10];

long volatile int a[10][10];

signed const int a[10][10];

signed volatile int a[10][10];

unsigned const int a[10][10];

unsigned volatile int a[10][10];

auto short const int a[10][10];

auto short volatile int a[10][10];

auto long const int a[10][10];

auto long volatile int a[10][10];

auto signed const int a[10][10];

auto signed volatile int a[10][10];

auto unsigned const int a[10][10];

auto unsigned volatile int a[10][10];

register short const int a[10][10];

register short volatile int a[10][10];

register short volatile int a[10][10];

register short volatile int a[10][10];

register short volatile int a[10][10];

register short volatile int a[10][10];

register short volatile int a[10][10];

register short volatile int a[10][10];

static short const int a[10][10];

static short volatile int a[10][10];

static long const int a[10][10];

static long volatile int a[10][10];

static signed const int a[10][10];

static signed volatile int a[10][10];

static unsigned const int a[10][10];

static unsigned volatile int a[10][10];

extern short const int a[10][10];

extern short volatile int a[10][10];

extern long const int a[10][10];

extern long volatile int a[10][10];

extern signed const int a[10][10];

extern signed volatile int a[10][10];

extern unsigned const int a[10][10];

extern unsigned volatile int a[10][10];

typedef short const int a[10][10];

typedef short volatile int a[10][10];

typedef long const int a[10][10];

typedef long volatile int a[10][10];

typedef signed const int a[10][10];

typedef signed volatile int a[10][10];

typedef unsigned const int a[10][10];

typedef unsigned volatile int a[10][10];