![Alok mishra](https://www.crazyengineers.com/img/avatar.jpg)
Member • Nov 20, 2013
Member • Nov 20, 2013
Administrator • Nov 20, 2013
Member • Nov 20, 2013
clear , say there is a pointer variable which is 2 byte large in size so what i am asking is what are these 2 bytes ,size of the address the pointer is pointing to ,or size of block of memory the pointer is pointing to (but the size of memory block the pointer is pointing to might be larger than 2 bytes ) ?Ankita KatdarePointer is a "variable" that stores the address of another variable, right?
Whenever we declare any variable, a random block of memory is chosen and value will be stored in that memory location.
Similars is the case with pointers!
Use sizeOf operator to check the size of any pointer variable.
Member • Nov 21, 2013
#include <stdio.h> #include <stdlib.h> main() { int a = 12; /* 4 bytes stored in memory system */ int *p = &a; /* 4 bytes stores in memory system for p and now p is pointing to a variable */ printf("Size of variable a = %d,Size of pointer variable p = %d\n",sizeof(a),sizeof(p)); /* Ouput : Size of variable a = 4 and Size of variable p = 4 */ }pointer is noting but a variable that points to its type.For example int pointer variable will only point to int variables.
Member • Nov 21, 2013
yes thats what i know but a statement in a book confused me .it(the book) was saying that pointer variables are 2 byte wide in DOS and 4 byte wide in windows/linux.Aadit Kapoor#include <stdio.h> #include <stdlib.h> main() { int a = 12; /* 4 bytes stored in memory system */ int *p = &a; /* 4 bytes stores in memory system for p and now p is pointing to a variable */ printf("Size of variable a = %d,Size of pointer variable p = %d\n",sizeof(a),sizeof(p)); /* Ouput : Size of variable a = 4 and Size of variable p = 4 */ }pointer is noting but a variable that points to its type.For example int pointer variable will only point to int variables.
But there is a void pointer which is like a generic pointer in c.It can contain any types of variables,but void pointers are not capable of pointer arithmetic operations.
Member • Nov 21, 2013
Member • Nov 21, 2013
As Anand Bhaiya said it varies from different operating system.Alok mishrayes thats what i know but a statement in a book confused me .it(the book) was saying that pointer variables are 2 byte wide in DOS and 4 byte wide in windows/linux.
Member • Nov 21, 2013
got itAadit KapoorAs Anand Bhaiya said it varies from different operating system.
Member • Nov 22, 2013
Member • Nov 22, 2013
Member • Nov 23, 2013
hardware engineering is mainly concerned with the establishment ,look after and maintenance of computer networks but also put focus on other hardware related issues related to power supply , computer components and peripherals etc .Aadit KapoorCan any one tell me what is hardware engineering?
Member • Nov 23, 2013
Member • Nov 23, 2013
Are you interested in maintaining hardware ? Something like 'troubleshooter' for computer hardwares ?Aadit KapoorCan any one tell me what is hardware engineering?
Member • Nov 23, 2013
I am interested in developing hardware & communicating hardware using programming languages.Abhishek RawalAre you interested in maintaining hardware ? Something like 'troubleshooter' for computer hardwares ?
Or you're rather interested in 'developing' hardware & communicating hardware using programming languages ?
Note that both are very different domain & in my opinion, latter one is rather very much interesting than the other one.
Member • Nov 23, 2013
Member • Nov 23, 2013
Member • Jan 24, 2014
Informative post.....najeeb88Thank so much for sharing your thought with your readers.
Member • Jan 25, 2014
One more thing,pointers were introduced by operating system vendors,that is why it comes 2 and 4 in dos and windows respectively.Alok mishrayes thats what i know but a statement in a book confused me .it(the book) was saying that pointer variables are 2 byte wide in DOS and 4 byte wide in windows/linux.