COMP 206 Lecture Notes - Lecture 12: Increment And Decrement Operators, Operand, Functional Programming

9 views4 pages

Document Summary

In c, like other languages, where you determine your variables determine how they"ll act inside your program. We can declare variables inside or outside functions. These variables apply to all functions underneath the declaration. You can"t talk about the global variable anymore once it is masked by a local one. It"s a terrible programming practice to mask variables -- don"t do it. The main way you build up c functionality is by declaring other functions and starting them inside main . Above is a program with two additional functions, declared in two different ways: void add(int,int) is declared on a single line. This means that the compiler will point to not changing those things. To satisfy this spec(ification), add the specification at the bottom (green box"s 2nd arrow) : void add(int a, int b) . giving the names of the arguments, and putting it in {}. , it will take two arguments. find a function at some point.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents