(C++ Question)Write a short note on ( void ) data type of about 4-5 lines
Now tell the meaning of --
void main()
void is a data type which is used before the functions which will not return any value.
void tells computer that the function will not return any value.
we can declare void data types where we don't know that which data type will b stored in that variable.
meaning of void main()
we know main() is a function, so void main() tells that main function will not return any value.
if we write only main() instead of void main(), there a error occurs telling that "main() function should return a value"
we can avoid it by returning a integer value from main function because integer is default return type in c++. or by using void main()
ex:-
main()
{
return 0;
}