#1
29th September 2014, 10:02 AM
| |||
| |||
Structure And Pointer in C What Is Difference
Will you please tell me the difference between the Structure and Pointer in C?
|
#2
29th September 2014, 12:05 PM
| |||
| |||
Re: Structure And Pointer in C What Is Difference
Structure in C refer to a collection of various data types for example you create a structure named "Student" which contains his name , roll no, DOB etc. Name is string, BOB is int. While pointer refers to address in C & are used to point some particular place in C memory. Pointers are constructs that point to the address location of a particular data type. Pointers also need to have data types associated with them, i.e. while declaring we have to define the data type of the pointer, for e.g. int * p; char * p1; but the pointer is just pointing to the memory location, which holds the particular variable. So by just changing the reference of the pointer, the same pointer can point to any variable of that particular data type. Pointer is dynamic in nature. The memory allocation can be resized or freed later. Pointer can’t be initialized at definition A pointer is a place in memory that keeps address of another place inside |
|