UrbanPro

Learn C Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Why can arrays not be given to functions?

Asked by Last Modified  

Follow 3
Answer

Please enter your answer

Oracle, Hindi, C++, C, MS Office, VBScript,JavaScript,Spoken English etc with 29 years of experience

In passing an array as a parameter to a function it is passed as a reference parameter. What is actually passed is the address of its first element. Since arrays are passed by reference this means that if the function changes the value of an element in an array that is a parameter of the function then...
read more
In passing an array as a parameter to a function it is passed as a reference parameter. What is actually passed is the address of its first element. Since arrays are passed by reference this means that if the function changes the value of an element in an array that is a parameter of the function then the corresponding actual array of the call will have that element changed. Though an array is passed as a reference parameter an & is not used to denote a reference parameter. However it must be indicated to the compiler that this parameter is an array by appending [] to the formal parameter name. read less
Comments

Cyber Security Trainer

In passing an array as a parameter to a function it is passed as a reference parameter. What is actually passed is the address of its first element. Since arrays are passed by reference this means that if the function changes the value of an element in an array that is a parameter of the function then...
read more
In passing an array as a parameter to a function it is passed as a reference parameter. What is actually passed is the address of its first element. Since arrays are passed by reference this means that if the function changes the value of an element in an array that is a parameter of the function then the corresponding actual array of the call will have that element changed. read less
Comments

Because, it also need one more argument i.e., a size of an array. Therefore arrays are usually passed by pointers
Comments

Expert Technical Trainer with 15 years of work experience

An array's reference becomes a pointer to the first element of the array. It uses the concept of "passing by call by value". By using "call by value" method, one can pass only one value. In C, except for a few special cases, an array reference always "decays" to a pointer to the first element of the...
read more
An array's reference becomes a pointer to the first element of the array. It uses the concept of "passing by call by value". By using "call by value" method, one can pass only one value. In C, except for a few special cases, an array reference always "decays" to a pointer to the first element of the array. Therefore, it isn't possible to pass an array "by value". An array in a function call will be passed to the function as a pointer, which is analogous to passing the array by reference read less
Comments

View 2 more Answers

Related Questions

Why is C still so popular?
C remains popular for several reasons, and its enduring popularity can be attributed to a combination of historical significance, efficiency, and versatility. Here are some key reasons why C is still widely...
A
0 0
6
Is it valid to address one element beyond the end of an array?
No, array is a fixed size memory allocation for variables. It is illegal to access elements beyond the allocated space.
Shivani
What is the use of semicolon at the end of every statement?
Computer languages are just like our normal communication languages. Hindi, eng etc. Enable to communicate us with each other. Similarly computer language helps us to communicate with computer. As a full...
Krishna
What is meant by “enum” in C?
An enum is a keyword in C language, it is an user defined data type. All properties of integer are applied on Enumeration data type It work like the Integer.
Geetanjali

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Some interview questions and answers for fresher level on Pointers
What is a void pointer? Void pointer is a special type of pointer which can reference or point to any data type. This is why it is also called as Generic Pointer. As a void pointer can point to...

Software Development Training In Jaipur
Satyam Web Solution provides website designing &development and software designing &development training in Jaipur for various stream’s students. MCA 6 month Industrial Training/Internship B....

Why C is a Language and not a database?
When I interviewed a candidate, I raised this question many times, but I have not got the answer correctly. To under why C is a language and not a database, it is good to understand why our communication...

Static and dynamic libraries
A library is a package of code that is meant to be reused by many programs. A static library (also known as an archive) consists of routines that are compiled and linked directly into your program. When...

Variables
Variables in C Language:A variable is a name that may be used to store a data value. Unlike constant, variables are changeable, we can change value of a variable during execution of a program. A programmer...

Recommended Articles

Lasya Infotech is a Hyderabad based IT training institute founded in 2016 by O Venkat. Believing in his innovation, passion and persistence and with a diverse blend of experience, he started his brainchild to deliver exemplary professional courses to aspiring candidates by honing their skills. Ever since the institute envisions...

Read full article >

Brilliant Academy is one of the reputed institutes for B.Tech tuition classes. This institute is specialised in delivering quality tuition classes for B.E, Engineering - all streams and Engineering diploma courses. Incorporated in 2012, Brillant Academy is a brainchild of Mr Jagadeesh. The main motto of the academy is to...

Read full article >

Software Development has been one of the most popular career trends since years. The reason behind this is the fact that software are being used almost everywhere today.  In all of our lives, from the morning’s alarm clock to the coffee maker, car, mobile phone, computer, ATM and in almost everything we use in our daily...

Read full article >

Almost all of us, inside the pocket, bag or on the table have a mobile phone, out of which 90% of us have a smartphone. The technology is advancing rapidly. When it comes to mobile phones, people today want much more than just making phone calls and playing games on the go. People now want instant access to all their business...

Read full article >

Looking for C Language Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for C Language Classes?

The best tutors for C Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C Language with the Best Tutors

The best Tutors for C Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more