- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is the size of void pointer in C/C++?
The size of void pointer varies system to system. If the system is 16-bit, size of void pointer is 2 bytes. If the system is 32-bit, size of void pointer is 4 bytes. If the system is 64-bit, size of void pointer is 8 bytes.
Here is an example to find the size of void pointer in C language,
Example
#include <stdio.h> int main() { void *ptr; printf("The size of pointer value : %d", sizeof(ptr)); return 0; }
Output
The size of pointer value : 8
In the above example, a void type pointer variable is created and by using sizeof() function, the size of void pointer is found out.
void *ptr; printf("The size of pointer value : %d", sizeof(ptr));
Advertisements