Declaration of pointers


Q1. Write down a suitable declaration for each of the given conditions comprising pointers.

a) Declare a function which accepts an argument that is a pointer to an integer quantity and returns a pointer to the six-element character array.

b) Declare a function which accepts an argument that is an integer array and returns a pointer to a character.

c) Declare a function which accepts an argument that is a pointer to an integer array and returns a pointer to the character.

d) Declare a pointer to a function which accepts an argument that is a pointer to an integer array and returns the character.

e) Declare a pointer to a function which accepts an argument that is an array of pointers to integer quantities and returns a pointer to the character.

Q2. Write down a function which accepts two strings str1 and str2 as arguments and find out which of the two is alphabetically greater (without employing the library functions). The function should return 1 if str1 is more than str2, 0 if str1 is equivalent to str2, and -1 if str1 is smaller than the str2.

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Declaration of pointers
Reference No:- TGS010797

Expected delivery within 24 Hours