Question: in c language 3. Pointer and referent. Write a program that creates the integer array int ara[] = {11, 13, 17, 19, 23, 29, 31).

in c language 3. Pointer and referent. Write a program that createsin c language

3. Pointer and referent. Write a program that creates the integer array int ara[] = {11, 13, 17, 19, 23, 29, 31). Also create an integer pointer pt and make it point at the beginning of the array. Write printf() statements that will print the address and contents of both ara[0] and pt. Use this format: printf( "address of pt: \t %p contents:\t %p ", kpt, pt ); Then write 10 similar printf() statements following the same format to print the address and contents of the slots designated by the following expressions: (+pt+3), *pt, (pt [3]), *&pt, *pt [3], &*pt, *(pt+3), (+pt++), * (pt++), (*pt)++. Some of these will cause compile-time errors when printing the address field, the contents field, or both; in such cases, delete the illegal expression and print dashes instead of its value. When the program finally compiles and runs, use the output to complete the following table, grouping together items that have the same memory address: Address Contents pt ara Finally, make four lists: (a) illegal pointer expressions, (b) expressions that have identical meanings, (c) expressions that change pointer values, and (a) expressions that change integer values. It will require careful reasoning to get the last two lists correct

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!