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 > Yes / No Questions - Discussion

Read more:

"In the middle of difficulty lies opportunity."
- Albert Einstein
4. 

Are the expressions arr and &arr same for an array of 10 integers?

[A]. Yes[B]. No

Answer: Option D

Explanation:

Both mean two different things. arr gives the address of the first int, whereas the &arr gives the address of array of ints.


Priya said: (Fri, May 6, 2011 02:38:27 PM)    
 
Someone explain this.

Krishma said: (Fri, Jul 29, 2011 10:44:30 PM)    
 
When I'm running an example of this.. &arr and arr are giving the same value. How?

Dave said: (Sat, Aug 20, 2011 12:27:37 PM)    
 
Can anyone explain it in depth. not able to get what they r saying..

Ram said: (Fri, Sep 30, 2011 10:11:25 PM)    
 
Try this

#include<stdio.h>
int main()
{
int arr[2];
printf("%d \n",arr);
printf("%d \n",(arr+1));
printf("%d \n",&arr);
printf("%d \n",(&arr+1));
}

Rupinderjit said: (Wed, Nov 23, 2011 05:06:39 PM)    
 
@Ram:You are right ,but the one thing here need to be consider is that, it also depends upon the dimensions of an array.you gave example of 1 D array.But problem is for @ D array.

In 2D array,an array in argument acts as a pointer(compiler dependent).so a(a+0) points to 1st row and a+1 points to second row and it's first element.

And &arr gives the address of array of ints(address of last element of an array which is equivalent to base address+size of type * number of elements).

Debendra Kumar Kar said: (Tue, Feb 7, 2012 12:58:06 PM)    
 
Both value will be same only the scaling factor will change.

So out put will be same and the answer will be A as yes.

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!