IndiaBIX.com
Arithmetic Aptitude Data Interpretation
Logical Reasoning Verbal Reasoning Non Verbal Reasoning
General Knowledge
Sudoku Number puzzles Missing letters puzzles Logical puzzles Playing cards puzzles Clock puzzles
C Programming C# Programming Java Programming
Networking Database Questions Computer Science Basic Electronics Digital Electronics Electronic Devices Circuit Simulation Electrical Enigneering Engineering Mechanics Technical Drawing
Placement Papers Group Disucssion HR Interview Technical Interview Body Language
Aptitude Test Verbal Ability Test Verbal Reasoning Test Logical Reasoning Test C Programming Test Java Programming Test Data Interpretation Test General Knowledge Test
Data Structures Operating Systems Networking DATABASE Database Basics SQL Server Basics SQL Server Advanced SQL Server 2008 JAVA Core Java Java Basics Advanced Java UNIX Unix File Management Unix Memory Management Unix Process Managemnt C Interview Questions The C Language Basics .NET Interview Questions .NET Framework ADO.NET ASP.NET Software Testing

C Programming - Arrays - Discussion

@ : Home > C Programming > Arrays > General Questions - Discussion

Read more:

"I never think of the future. It comes soon enough."
- Albert Einstein
3. 

In C, if you pass an array as an argument to a function, what actually gets passed?

[A]. Value of elements in array
[B]. First element of the array
[C]. Base address of the array
[D]. Address of the last element of array

Answer: Option A

Explanation:

The statement 'C' is correct. When we pass an array as a funtion argument, the base address of the array will be passed.


Ganesh said: (Sun, Aug 14, 2011 01:02:43 PM)    
 
Since arrays name represent its base adress.

Shakil said: (Wed, Aug 24, 2011 02:23:06 PM)    
 
Can anyone exaplin this in detail please.

Sameera said: (Sat, Jan 28, 2012 11:50:12 AM)    
 
Take a[5], it will store address of a[0] in a. when it will access the array only by a it will increment a or it will take a+1,a+2,a+3 and so on.

When array is passed to any function we will pass as

add(a);

In definition it will take it in pointer and access whole array

Hence at the time of passing array it will pass only base address i.e. address of first element of array.

Write your comments here:
Name *:     Email:


© 2008-2011 by IndiaBIX™ Technologies. All Rights Reserved | Copyright | Terms of Use & Privacy Policy

Advertise     Contact us: info@indiabix.com     Follow us on twitter!