What is the real difference between arrays and pointers?
Answers were Sorted based on User's Feedback
Answer / subhasmita swain
arrays stores a block of contigious memory .where as
Pointers are save the base address of the block of
memory,it may be a array of datas.pointers can resize them
shelves by pointing to a different block of memory,in
contrast arrays are fixed size.
Is This Answer Correct ? | 5 Yes | 3 No |
Answer / vipul singh
there is only a single difference between array and pointer,
in c lang array is limited(limited in the sense,define the
size at complie time) while pointer are upto memory location.
array and pointer both point to the initial
address.
if somebody says it is wrong so pls tell me the correct
difference.
im vipul from jaipur doing MCA 2nd sem.
my email id is vipul.fifteen@yahoo.com
Is This Answer Correct ? | 4 Yes | 2 No |
Answer / ajay kumar
The name of the array represents the base address of the array. Thus, the name of the array can be used effectively as any other pointer to an array in accessing the elements of the array.
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / ravi
Array is simply collecton of similar datatype and the pointer is a variable that represents the location of that data.
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / bhavani.p
Array is slow,array refer data in memory location.
Pointer is fast,pointer refer address to the memory location....
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / revathi
Array supports static memory allocation in the sense the memory size is allocated before it can use
Pointer supports dynamic memory allocation in the sense the memory is resized
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / saurabh agarwal
array name is a unmodifiable lvalue whereas pointer is a modifiable l value
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / shubham arora
1-through pointers we can access data directly while in array we have to traverse the whole array for accessing particular data.
2- due to above reason accessing through pointers is fast than
array.
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / anu yadav
array can be of any size whereas pointer is always of 2 byte......
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / sachin.r
Arrays allocate the memory during compile time.
Pointers allocate the memory during runtime.
Is This Answer Correct ? | 1 Yes | 0 No |
You are given a string which contains some special characters. You also have set of special characters. You are given other string (call it as pattern string). Your job is to write a program to replace each special characters in given string by pattern string. You are not allowed to create new resulting string. You need to allocate some new memory to given existing string but constraint is you can only allocate memory one time. Allocate memory exactly what you need not more not less.
Why #include is used in c language?
What is Full Form of C and Why We use C
WAP to accept basic salary of an employee? Calculate it HRA=25%,DA=30%,PF=30%&net salary display all contents?
6 Answers Finite Infotech, Lovely Professional University, Wipro,
to print the salary of an employee according to follwing calculation: Allowances:HRA-20% of BASIC,DA-45% of BASIC,TA-10%. Deductions:EPF-8% of BASIC,LIC-Rs.200/-Prof.Tax:Rs.200/- create c language program?
How can I read data from data files with particular formats?
What is the output of following program ? int main() { int x = 5; printf("%d %d %d\n", x, x << 2, x >> 2); }
what is the difference between const volatile int i & volatile const int j;
Write a c code segment using a for loop that calculates and prints the sum of the even integers from 2 to 30, inclusive?
Write a c program to demonstrate Type casting in c?
Write a c program to read a positive number and display it in words.? ex: 123=one two three help me....
What are near, far and huge pointers?
0 Answers Hexaware, Thomson Reuters, Virtusa,