How can a function return a pointer to its calling routine, Computer Engineering

Assignment Help:

How can a function return a pointer to its calling routine?

The general form of a function is:

type_specifier function_name(parameter list)

{

body of function;

}

where type_specifier specifies the type of value that the function's return statement returns and the parameter list is a comma-separated list of variable names and types which receive the values of the arguments passed by the call to the function. The purpose of most functions is to either perform a computation and return a value, manipulate information and return a success-or-failure (true or false) value, or perform a strictly procedural routine which produces no value (eg, the exit() function). Functions may be declared to return any valid C data type. If the  return  type  is  not  specified,  it  automatically  defaults  to  type  int.  return  causes  an immediate exit from a function. It may also be used to return a value. All functions, except those of type void, return a value.

Functions that return pointers are handled just like any other type of function, e.g.:

char * match(char c, char *s)

{

while(c != *s && *s)

s++;

return(s);


Related Discussions:- How can a function return a pointer to its calling routine

Fitness function - canonical genetic algorithm, Fitness function - canonica...

Fitness function - canonical genetic algorithm: Conversely the fitness function will use an evaluation function to calculate a value of worth for the individual accordingly th

Associative array processing, Consider that a list of record or a table is ...

Consider that a list of record or a table is stored in the memory and you wish to find some information in that particular list. E.g. the list comprises three fields as displayed b

What is the standard template library (stl), A library of container templat...

A library of container templates approved by the ANSI committee for inclusion in the standard C++ specification. A programmer who then launches into a discussion of the generic

What is microprocessor, Microprocessor is a program-controlled device, whic...

Microprocessor is a program-controlled device, which fetches the instructions from memory, decodes and implements the instructions. Most Micro Processor is single- chip devices.

Set up this problem as an lp problem, The Laser Computer Printer Company de...

The Laser Computer Printer Company decides monthly what to produce during the subsequent month. They produce three types of printers, the Laser Rocket, the Alpha Laser, and the La

What is SSTF, SSTF stands for ? Ans. Shortest-Seek-time-first scheduli...

SSTF stands for ? Ans. Shortest-Seek-time-first scheduling.

Network message transfer, Consider a network message transfer among a sourc...

Consider a network message transfer among a source S and a destination D by 3 routers R1, R2 and R3 as given below:-               S -------- R1 --------- R2 --------- R3 ---

Applications of thermodynamics, Discuss the applications of thermodynamics ...

Discuss the applications of thermodynamics in field of energy technology Sol: Thermodynamics has wide applications as basis of thermal engineering. Nearly all process and engi

What is branch instruction, What is branch instruction? As a result of ...

What is branch instruction? As a result of branch instruction is a type of instruction which loads a latest values into the program counter.

The 2''s complement of the decimal number, What is the 2's complement of th...

What is the 2's complement of the number 1101101 ? Ans. 0010011 is the 2's complement of the number 1101101. As 1's complement of the number 1101101 is 0010010 and 2's comple

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd