Lec8ReviewInClass

Lec8ReviewInClass - 4 categories on exam: 1) short answer...

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

View Full Document Right Arrow Icon
4 categories on exam: 1) short answer (has OO in it) 2) File processing (command-line args, file I/O, string manipulation) 3) Linked Lists 4) Drawing the result Sample Short Answer Questions: Name one principle of object-oriented programming Encapsulation, abstract data types, information-hiding Explain why encapsulation helps software development If you want to split work in a large project, you don’t need to look at others’ code – just the .h file. Reduces programming bugs because you can’t edit someone else’s code. For linked list, what is the name of the pointer that always points to the first link in the linked list? head What type is a C string? char array char * What type is an array of C strings? char ** What type is an array of an array of C strings? char *** What is the output for this code? void foo1(int a) { a = 5; } { a = 7; } int x = 10; foo1(x); printf(“%d\n”,x); foo2(x); printf(“%d\n”,x); 10 7 File Processing In a program, what variable tells you how many command-line arguments there are? argc
Background image of page 1

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

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

This note was uploaded on 12/27/2011 for the course CMPSC 24 taught by Professor Agrawal during the Fall '09 term at UCSB.

Page1 / 2

Lec8ReviewInClass - 4 categories on exam: 1) short answer...

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

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