06-C-Modular - ECE 175 Introductory C for Engineers Modular Programming ECE 175 Computer Programming for Engineering Applications Modular

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: ECE 175: Introductory C for Engineers Modular Programming 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 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?...
View Full Document

This note was uploaded on 04/10/2008 for the course ECE 175 taught by Professor Grubbs during the Spring '08 term at University of Arizona- Tucson.

Page1 / 10

06-C-Modular - ECE 175 Introductory C for Engineers Modular Programming ECE 175 Computer Programming for Engineering Applications 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