What is the real difference between arrays and pointers?
Answer Posted / jaroosh
Arrays are simply pointers THAT CANNOT be reassigned, ie,
constant pointers to some memory locations. They do not
"magically preserve" any information about array size or
whatever that some suggest, they are just a type of constant
pointers, nothing more.
For example , the following :
int a[] = {1,23};
a++;
will throw a compiler error, something like : a is not an
Lvalue, which means that you cannot assign or change the
value of a.
Is This Answer Correct ? | 64 Yes | 14 No |
Post New Answer View All Answers
Write a code of a general series where the next element is the sum of last k terms.
How to delete a node from linked list w/o using collectons?
What is the use of putchar function?
what type of questions arrive in interview over c programming?
Is swift based on c?
What is structure data type in c?
Write a program to input the price of 1 burger and the number of burgers eaten by a group of friends .print the total amount to be paid by the group?
What is the difference between malloc calloc and realloc in c?
What will be your course of action for a push operation?
How do I create a directory? How do I remove a directory (and its contents)?
To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9
Explain what does it mean when a pointer is used in an if statement?
What are the 4 types of programming language?
Write programs for String Reversal & Palindrome check
In this assignment you are asked to write a multithreaded program to find the duplicates in an array of 10 million integers. The integers are between -5000,000 to 5000,000 and are generated randomly. Use 10 threads, each thread works on 1000,000 integers. Compare the time needed to accomplish the task with single thread of execution program. Do not include the time to fill the array with integers in the execution time.