+ 2
What is the output of the following code?
#include<stdio.h> int main() { void n=5; printf("%v",n); return 0; }
2 ответов
+ 7
Srija Padmanabhuni hi,
An object of void type cannot be declared. But void pointers can be defined.
If you want to use void then use it directly as void doesn't contain any value
#include <stdio.h>
int main() {
printf ("%v",5);
return 0;
}
void pointers example
int a = 5;
char b = 'x';
void *p = &a; // void pointer holds address of int 'a'
p = &b;
if you have any query then ping me
have this 🍎 🍎 🍎 🍎 🍎
+ 2
Thank you 😊 DishaAhuja