C Programming - Declarations and Initializations - Discussion
Discussion Forum : Declarations and Initializations - Point Out Errors (Q.No. 2)
2.
Point out the error in the following program.
#include<stdio.h>
int main()
{
void v = 0;
printf("%d", v);
return 0;
}
Discussion:
166 comments Page 14 of 17.
Hemant said:
1 decade ago
We cannot declare void variable.
Can only make void pointer.
Can only make void pointer.
Bharath said:
8 years ago
Void itself is a null value. You cannot declare a null value.
Nithin said:
2 decades ago
void is a return type and variable should not declare to it.
Karthi said:
2 decades ago
Void is a return type. It cannot be assigned for variables.
Devanshmody said:
1 decade ago
Data type should be of int or one can use typedef function.
R.Harish said:
1 decade ago
void is not an data type.
void does not return any value.
void does not return any value.
Ankit said:
1 decade ago
In simple terms void can not be assigned any value .....
Pavani said:
1 decade ago
We cannot declare a variable with void as data type.
Keya said:
1 decade ago
Void is prototype so we can not initialize variable.
Shruthi hebbal said:
2 decades ago
I think there is no datatype as void in c language.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers