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

Which is the best software for working with C language?
Choosing the best software for C programming often depends on personal preference, but popular options include GCC (GNU Compiler Collection), Visual Studio, and CLion. Consider factors like your platform,...
Kiran
0 0
6
how to calculate address of n dimensional matrix
An n dimensional matrix can be of any dimension. Adding a dimension is adding one more index number (to access the element). In 1-D array you the elements are linearly arranged and can be addressed as...
Rupendra
How can you be sure that a program follows the ANSI C standard?
The ANSI C standard provides a predefined symbol named __STDC__ that is set to 1 when the compiler is enforcing strict ANSI standard conformance. If you want your programs to be 100 percent ANSI conformant,...
Vibha
What are the toughest topics in C language?
1. pointer 2. dynamic memory allocation 3. File handling
Lokayya
0 0
5
Give the structure of 'C' programming. Also, give significance of math.h and string.h header files.
Hi, C structure is procedural programming. math.h and string .h will have a declerations of predefined methods. math.h ex: sqrt(),...etc. string.h ex: strlen(),strcpy,...etc. if you wanna brif let meknow. Thanks.
Ishwari

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

Ask a Question

Related Lessons

INTRODUCTION TO PROGRAMMING LANGUAGES
Language is a medium for communication. If we want to perform anything with another person, we can know the human language as a human being. Similarly, if we want to perform anything with a computer, we...

C for Begginers
C is an procedure oriented programming language. For any begginer the word program is new. Program: Set of instructions to be followed by machine or computer. Instruction Examples: Arithmetic instruction...

Operators in C
Operators in C Operator: An operator is a symbol that tells the compiler to perform certain mathematical or logical calculations. Operators are used in programs to manipulate data and variables. The...

Advantages of C++ Language
Advantages of C++ - C++ is a profoundly convenient dialect and is frequently the dialect of decision for multi-gadget, multi-stage application advancement. - C++ is a protest situated programming dialect...

C and C++ programming with memory level debugging
Understanding C and C++ programming by using memory level debugging. Step 1: Understand the Memory map of C executable Step 2: Start memory level debugging using popular IDE Step 3: Find the memory...

Recommended Articles

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 >

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 >

Applications engineering is a hot trend in the current IT market.  An applications engineer is responsible for designing and application of technology products relating to various aspects of computing. To accomplish this, he/she has to work collaboratively with the company’s manufacturing, marketing, sales, and customer...

Read full article >

Information technology consultancy or Information technology consulting is a specialized field in which one can set their focus on providing advisory services to business firms on finding ways to use innovations in information technology to further their business and meet the objectives of the business. Not only does...

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