c notes
DESCRIPTION
about c programming languageTRANSCRIPT
1. scanf("%d",&n) // use of & in scanf
2. call by reference: a. sum(int *x,int *y)b. sum(&a,&b);
3. pointer arithmetic:a. difference of pointers:b. possible only if both the pointers point to the elements of same arrayi. int *j=&a[1];ii. int *k=&a[5];iii. scanf("%d",k-j); // o/p is 4 => 4 integers apart
4. Comparison of two pointer variablesa. Pointer variables can be compared provided both variables point to objects of the same data type
5. Following operations on pointers will not work:1. Addition of two pointers2. Multiplication of a pointer with a constant3. Division of a pointer with a constant6. Accessing array elements by pointers is always faster than accessing them by subscripts7. Passing an Entire Array to a Functiona. main( ) { b. int num[ ] = { 24, 34, 12, 44, 56, 17 } ;c. dislpay ( &num[0], 6 ) ; d. } e. display ( int *j, int n ) {i. int i ; f. for ( i = 0 ; i