C-Modular

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

Info iconThis 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
Background image of page 1

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

View Full DocumentRight Arrow Icon
ECE 175: Introductory C for Engineers - 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 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
Background image of page 2
ECE 175: Introductory C for Engineers - 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? Declare the variables that you need in main
Background image of page 3

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

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

Page1 / 9

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

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online