what is void pointer?
Answer / himaja
pointers can also be declared as void type.void pointers cant be dereferenced without explict type conversion,this is becoz being void the compiler cnt determine the size of object that pointer points to,though void vaariables declared is not allowed,thus void p displays error msg "size of p is unknown or 0" after compilation
#include<stdio.h>
int p;
float d;
char c;
void *pt=&p;
void main(void)
{
clrscr();
*(int*)pt=12;
printf("\n p=%d",p);
pt=&d; /*pt points to d*/
*(float*)pt=5.4;
printf("\n r=%f",d);
pt=&c; /*pt points to c*/
*(char*)pt=H;
printf("\n c=%c",c);
o/p:
P=12
R=5.4
C=H
| Is This Answer Correct ? | 6 Yes | 0 No |
to get a line of text and count the number of vowels in it
List the difference between a While & Do While loops?
Define Array of pointers.
Explain the concept of "dangling pointers" in C.
Write a c code segment using a for loop that calculates and prints the sum of the even integers from 2 to 30, inclusive?
send me the code of flow chart generator using C-programming language amd this code should calculate the time and space complexity of the given progran and able to generate flowchart according to the given program?
What is the full form of getch?
how do you programme Carrier Sense Multiple Access
Write a program in C to reverse a number by recursive function?
In a header file whether functions are declared or defined?
What's the best way of making my program efficient?
main() { int arr[5]={23,67}; printf("%d%d%d",arr[2],arr[3],arr[4]); }