class_23 - Software Engineering 3156 28-Nov-01 #23: OS,...

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

View Full Document Right Arrow Icon
Software Engineering 3156 28-Nov-01 #23: OS, Language, Design Patterns Phil Gross
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Administrivia Integration prototype is up JSP and Servlets Wednesday, Nov 28 th , 6-8pm Final exam Very little C++/OS A bit of C Research Fair this Friday
Background image of page 2
3 More on C Will be on next homework Need to be able to do basic stuff Simple C++ is generally easier than C Although C++ is capable of being much more complicated
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 Miscellany on structs Since not everything happens in main, malloc’ing structs is very common The sizeof operator works on pretty much any datatype, be it structs or primitive datatypes Guaranteed tip: you will come across PointP myP = (PointP)malloc(sizeof(PointP)); and be glad that you were attending this class…
Background image of page 4
5 Miscellany on structs (*myP).x is messy C has a shortcut: myP -> x Always remember that a -> b is equivalent to (*a).b Precedence of operators It’s cumbersome to have to say struct Point every time Use typedefs: define “aliases” typedef struct Point PointT; or even typedef struct Point *PointP;
Background image of page 5

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

View Full DocumentRight Arrow Icon
6 Function prototypes As I said, C’s compiler is not all that smart If you have: int main(void) { int i = foo(); } int foo(void) { return 5; } It will not work
Background image of page 6
7 Function prototypes (II) Need to clue in the compiler by putting the following prototype before main: int foo(void);
Background image of page 7

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

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

This note was uploaded on 06/09/2010 for the course COMS 3156 taught by Professor Philgross during the Fall '01 term at Columbia.

Page1 / 24

class_23 - Software Engineering 3156 28-Nov-01 #23: OS,...

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

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