Week 8 Notes COP3014
Week 8 Notes COP3014 COP 3014
Popular in Programming I
Popular in Engineering and Tech
This 6 page Class Notes was uploaded by Annette Marin on Tuesday November 3, 2015. The Class Notes belongs to COP 3014 at Florida State University taught by Melina Vastola in Fall 2015. Since its upload, it has received 92 views. For similar materials see Programming I in Engineering and Tech at Florida State University.
Reviews for Week 8 Notes COP3014
Report this Material
What is Karma?
Karma is the currency of StudySoup.
Date Created: 11/03/15
Pass By Reference vs Pass By Value 11315 656 PM incude void twiceint int int main I inta3b5 cout ltlt a isquot ltlt a ltlt bis ltlt b ltlt endl twice a b cout ltlt a isquot ltlt a ltlt b is ltlt b ltlt endl return 0 void twice int X int y X X 2 yyz int X 10 X int amp y x 6 says give X the nickname of y cout ltlt y 10 yy cout ltlt X 6 13 inta5 ab intampba cout ltlt a 3 b 68 coutltlt a 64 These are ALL acceptable 6 but this one is recommended void Funkint int amp int main 5 N int numl 5 num2 10 uml e 1 Funk numl num239 cout ltlt numl ltlt num2 b0 return 0 void Funkint a int amp b aa3 Remember Pass By Reference COPY IS MADE Pass by Value Reference Const Reference Copy made yes no no Can func change orig no data Can I pass yes no yes a lit value main inty 10 Func3y in Func3 NO X X NO X X1O ARRAYS Very big topic To declare an array 1 Declare a type arr 9 O 2 Pick a name for it 3 Specify array 1 2 3 4 Ex int arr5 arr2 4 arr4 10 6 int thing6 426 1037 cout ltlt thingS 7 cout ltlt thingO thingZ 2 forint i O i lt 6 i cout ltlt thingi 11315 656 PM 11315 656 PM