Member • Nov 20, 2013
-
Alok mishraWhat does it mean when we say size of a pointer is 2 bytes under DOS and 4 bytes under windows/linux ? What does this 'size ' refer to in context of pointers ? Please help
-
Administrator • Nov 20, 2013
Pointer 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.Are you sure? This action cannot be undone. -
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.Are you sure? This action cannot be undone. -
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.
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.Are you sure? This action cannot be undone. -
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.Are you sure? This action cannot be undone. -
Member • Nov 21, 2013
The size refers to the size of data type which in fact is different in DOS and other OSes. This is required by specification.Are you sure? This action cannot be undone. -
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.Are you sure? This action cannot be undone. -
Member • Nov 21, 2013
got itAadit KapoorAs Anand Bhaiya said it varies from different operating system.Are you sure? This action cannot be undone. -
Member • Nov 22, 2013
Thank so much for sharing your thought with your readers.
#-Link-Snipped-#Are you sure? This action cannot be undone. -
Member • Nov 22, 2013
Can any one tell me what is hardware engineering?Are you sure? This action cannot be undone. -
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?Are you sure? This action cannot be undone. -
Member • Nov 23, 2013
How to get started in hardware engineering?Are you sure? This action cannot be undone. -
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?
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.Are you sure? This action cannot be undone. -
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.
How do i get started in this?Are you sure? This action cannot be undone. -
Member • Nov 23, 2013
I am currently learning C and Data structures.Are you sure? This action cannot be undone. -
Member • Nov 23, 2013
Learning programming languages is good & C is obviously good start. But don't start picking up languages one after another like all others do,stick with C/Embedded C.(Python & Vala is fun language too,just saying).Also avoid learning languages like Java or C++ for now.Learning these languages won't do anything wrong, but remember that you're dealing with hardware so it is better to consume time in learning & understanding basics of electronics & understanding hardware first, you can pick on other languages later.
I am not in position in giving suggestions,as I am too a student myself & trying to march towards Embedded linux. But I can ask you to do same what I did :
Understand Basics of electronics, Learn Digital logic design, Start learning 8086/80386 & Intel-51 family.
Read Assembly language step-by-step Programming with Linux by Duntemann,awesome book!
Fun part starts now,Buy arduino,RPi & start creating something.(I am in this phase now)
What next ? well I don't know too, But I am planning to learn RTOS, Linux Kernel,GNU toolchain & ARM.Are you sure? This action cannot be undone. -
Member • Jan 24, 2014
Informative post.....najeeb88Thank so much for sharing your thought with your readers.Are you sure? This action cannot be undone. -
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.Are you sure? This action cannot be undone.