10 - ICS 103 Computer Programming in C Handout-10 Topic Function Output Parameters Implemented with Pointers(OR Function with Output Parameter Objective

10 - ICS 103 Computer Programming in C Handout-10 Topic...

This preview shows page 1 - 2 out of 5 pages.

ICS 103: Computer Programming in C Handout-10 Topic: Function Output Parameters Implemented with Pointers ( OR Function with Output Parameter) . Objective: To know how a function can return more values using output parameters. To know some basic concept about pointers. To study some examples on above concepts. Functions with output parameters using pointers: Till now we used only the functions that returned zero or one value through the  return  statement. To return more  than one value, we need to use the output parameters , which are  pointers . Note that when we use output  parameters in functions we declare those functions as  void  returning functions because they are not returning any  value by return statement. Basic Concept about Use of Pointers: What is Pointer  ?  :  A pointer variable is a special variable, which stores the address of other variable. If a pointer variable stores the  address of a char variable, we call it a character pointer and so on.                                    Normally a variable directly contains a specific value. A pointer, on the other hand, contains an address of a  variable that contains a specific value.  Pointers like any other variables must be declared before they can be used.   To handle pointers in C language we use two unary operators:  &, *   &   : Address operator (ampersand symbol) *   :  Pointer operator OR Indirection operator OR Value at address.    Examples: int *j -------- à  Means the value at address contained in  j is an int OR in other words j is an integer pointer.
Image of page 1
Image of page 2

You've reached the end of your free preview.

Want to read all 5 pages?

  • Spring '10
  • zaman
  • main program, output parameters

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes