FreePrograms


C language is a middle level language. It is a structured language. C language is a case sensitive language. All syntax written in c language is in lower case. C is the basis for C++.
  CONTACT US   ABOUT US   PRIVACY  DISCLAIMER

FREE C PROGRAMS 

What is C C vs C++ vs Java Program Structure Data Types in C Basic Rules of C & C++
Functions in C If, Else Conditions Loops in C Switch Case Arrays
Pointers Structures in C Strings in C Command Line Arguments Type Casting
Linked Lists Recursion Binary Trees Inheritance Multiple Inheritance
Templates File I/O Object Oriented Programming Data Structures in C C interview Questions

c void data type

C Data type - void

Actual meaning of void is nothing. Size of void data type is meaningless question.

What will be output of following c code?
#include<stdio.h>
int main(){
int size;
size=sizeof(void);
printf("%d",size);
return 0;
}

Output will be Compilation error

If we will try to find the size of void data type complier will show an error message “not type allowed”.
We cannot use any storage class modifier with void data type so void data type doesn’t reserve any memory space.
Hence we cannot declare any variable as of void type i.e.
void num; //compilation error

Use of void data type

1. To declare generic pointer
2. As a function return type
3. As a function parameter.




 

 

 

COPYRIGHT 2009 ALL RIGHTS RESERVED FREECPROGRAMS.COM