C Programming - Pointers - Discussion

Discussion Forum : Pointers - Yes / No Questions (Q.No. 5)
5.
Will the following program give any warning on compilation in TurboC (under DOS)?
#include<stdio.h>

int main()
{
    int *p1, i=25;
    void *p2;
    p1=&i;
    p2=&i;
    p1=p2;
    p2=p1;
    return 0;
}
Yes
No
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
21 comments Page 2 of 3.

Kariyappa said:   1 decade ago
No error, because void pointer can take any datatype.
(1)

Srini said:   1 decade ago
Is void used to store only data? I can't understood.

Srisailam said:   8 years ago
In GCC compiler showing no error and no output.

Sangee said:   1 decade ago
Error :invalid conversion from void* to int *.

Mohammad Shabaz said:   4 years ago
Why can't we use Arithmetic on void pointers?

Mahesh said:   1 decade ago
No error in DOS also. I checked it.

Aarzu said:   9 years ago
What is use of void pointer?

Diksh said:   1 decade ago
I agreed with sonal.
(1)

Raj said:   9 years ago
Please explain it.

Divya said:   9 years ago
It's impossible.
(1)


Post your comments here:

Your comments will be displayed after verification.