{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

06-C-Modular - ECE 175 Introductory C for Engineers Modular...

Info icon This preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
ECE 175: Introductory C for Engineers Modular Programming
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
ECE 175: Computer Programming for Engineering Applications - Modular Programming Variables: Values and addresses Variables are assigned memory locations When we refer to the variable in the program, we refer to its value; a = 10; Memory is allocated during at the time of variable declaration Memory is released when the function is completed Pointer and value Pointer: Refers to the memory location &a = 001 Value: If ptr is a pointer, then *ptr is the value in that memory location Example: * (& a) = 10 Life of a variable A variable declared between a { and } lives as long as the program is executing the statements within those parentheses Holds for functions as well 2 a 001 10 b 002 20 c 003 A d 004 25.35 Variables Memory Locations Values
Image of page 2
ECE 175: Computer Programming for Engineering Applications - Modular Programming Functions with simple output parameters So far... We have used simple functions Send multiple parameters and receive one result How do we get multiple values for output when calling a function from main?
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

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