- How will you define an array?
- Is it necessary to specify the storage class in array definition? what is the default storage class for arrays?
- If the array elements are not initialized then what is the default initial value?for example: int x[5]; what is the value of x[1]?
- Consider we have a 10 element array what happen if we try to access the 12th element?
- Can I declare the array without specifying the size? int a[]; is it allowed?
- int a[]={1,2,3,4,5}; Is it allowed?
- Consider int a[5]={1,2,3,4,5}; printf("a=%d",*a); what is the output?
- Consider int a[5]={10,20,30,40,50}; printf("a=%d",a); what is the output?
- The last character in a array must be a NULL(\0) character what happen if I missed the '\0' character? char vowels[6]={'a','e','i','o','u'}; Is it correct?
- What happen If I am not giving space for '\0' character? char flag[4]={'T','R','U','E'}; is it correct?
- What happen If I am not giving space for '\0' character in string? char str[5]="Welco"; is it correct?
- x is a array pointer. what is the value for *x++;
- Is there any way to find the size of the array?
- Can I print the characters given in single quotes as string?
- What is the output for the following program?
#include<stdio.h> int main() { char x[]={'a','e','i','o','u'}; printf("ans=%s",x); return; }
- What is the output for the following program?
#include <stdio.h>int main(){ int x[5]={10,20,30,40,50};printf("ans=%d",(*x)++);return;} - What is the output for the following program?
#include <stdio.h>int main(){int x[5]={10,20,30,40,50};printf("ans=%d",++*x);return;} - Do we have any minimum or maximum size restrictions in array index?
- What is the maximum index(sixe) number an array can have?
- Why array index is starting from zero? (or) Why arrays not store values from 1?
- Can I declare an array with 0 size? int a[0]; is it allowed?
- Can I declare an array with negative size? int a[-5]; is it allowed?
- Can I compare 2 arrays with single operator?
- Can I have comma(,) alone in the array list? int x[5]={,,,,}; Is it allowed?
- What happen if the array size is less than the number of initialized values?int a[5]={1,2,3,4,5,6,7,8,9,}; is it allowed?
- How to pass and access the array values to the function using call by value method?
- How to pass and access the array values to the function using call by reference method?
- Array name is a pointer. If an array is passed to a function and several of its elements are altered with in the function, are these changes recognized in the calling portion of the program?
- Can an array can be passed from a function to the calling portion of the program via return statement?
- Is there is any difference in storing 1 dimensional array and multi dimensional array?
- How the elements of a 2 dimensional array is stored? row major form (or) column major form?
- what is the size of a 2 dimensional array, 3 dimensional array?
- In 2 dimensional array number of rows specified first or number of columns specified first?
- Is it necessary to specify both number of rows and number of columns in 2 dimensional array?
- Can I leave the number of columns in 2 dimensional array? int a[5][]; is it allowed?
- Can I initialize a[][]={1,2,3,4,5,6,7,8,9}; (or) a[5][]={1,2,3,4,5,6,7,8,9};
Pages
The greatest mistake you can make in life is to be continually fearing you will make one
Thursday, 9 December 2010
Some Questions about Arrays
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment