Computer Science, asked by oliofficial004, 5 months ago

Write the prototype of a function check which takes an integer as an argument and returns a character array. please guys help..

Answers

Answered by birbald630gmailcom
5

Answer:

Write the Prototype of a Function Check Which Takes an Integer as an Argument and Returns a Character. Concept: Access Specifiers Scope.

Explanation:

follow me I will answer your every question

Answered by ankhidassarma9
0

Answer:

A function can return a reference to an array. The return type of a function must be declared as an array of the correct data type.

So,  the prototype of a function check which takes an integer as an argument and returns a character array is :

char * check( int );

Explanation:

  • C/C++ or JAVA programming does not allow to return an entire array as an argument to a function.
  • We can return a pointer to an array by specifying the array's name without an index. Allocate an array on the heap using malloc() function, and return a pointer to it.
  • Another point to remember is that C does not allow to return the address of a local variable to outside of the function, so we would have to define the local variable as static variable.
  • Although functions cannot return arrays, arrays can be wrapped in structure and the function can return the struct thereby carrying the array with it.
Similar questions