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:

"Act well your part; there all honor lies."
- Alexander Pope
3. 

Is there any difference int the following declarations?
int fun(int arr[]);
int fun(int arr[2]);

[A]. Yes[B]. No

Answer: Option C

Explanation:

No, both the statements are same. It is the prototype for the function fun() that accepts one integer array as an parameter and returns an integer value.


Bhavesh said: (Mon, Jun 13, 2011 01:24:15 AM)    
 
The first statement signifies that any number of elements are possible in the array ?

Arun said: (Fri, Jul 22, 2011 05:23:19 PM)    
 
You can pass an array of any size in d first one, where as in the 2nd one you can atmost pass an array of size 2.

Rahul said: (Mon, Sep 5, 2011 12:00:29 PM)    
 
According to Comments given by @Bhavesh and @Arun how is it possible that both are same statements,bcoz the size is different for array in the declarations.

Niyati said: (Wed, Nov 16, 2011 11:25:33 AM)    
 
I am satisfied with Arun,in 1st function declaration there is no specification of the size of array it accepts i.e. it can take an array of any size, but in second function declaration there is size of array specified so it can accept the array of atmost size 2,then How can these two statements be same

Maikal said: (Tue, Dec 20, 2011 09:59:06 PM)    
 
Thanks niyati, your question is very intresting but can you say me what will be the fix size in int arr[2]& int arr[] when int is not define. So its are same because thease are prototype function.

Raj said: (Sun, Dec 25, 2011 01:27:46 AM)    
 
Thanks niyati nice explanation.

Vijay said: (Mon, Jan 2, 2012 03:04:38 PM)    
 
In give example,
int fun(int arr[]) is the passing the base element of an array & on other hand int fun(int arr[2]) is passing the third element of array. then why they r equal ?

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!