COMPSCI 230 Lecture Notes - Lecture 4: Gnu Debugger, In C

14 views2 pages
J"v" is OO L"ngu"ge. C is procedur"l.5
J"v" is "n interpreted l"ngu"ge. C is " compiled l"ngu"ge.5
J"v" -> Byte Code -> its interpreted by JVM. C is compiled then executed by the
underlining processor.5
J"v" is high level. C is low level.5
D"t" types in C "re dependent on the m"chine you "re running.5
J"v" doesnʼt let you "ccess memory directly. In j"v" we h"ve references to
objects directly.5
C "llows you to "ccess memory directly, these references "re c"lled pointers
J"v" h"s "utom"tic g"rb"ge collection. C provides m"nu"l memory m"n"gement.
You need to get rid of pointers you do not need "nd rele"se it b"ck to the OS
C is " good l"ngu"ge to explore how the system works under-the-hood.5
GNU compiler collection - gcc gdb em"cs5
#define LETTERCOUNT 26
#define Letter ‘"ʼ555 555 555 555 555 55 5 //the preprocessor processes these. They "re not
v"ri"bles 5
Ch"r foo = Letter;
Int "lph"bet_length = LETTERCOUNT;
Multi line
// single line comments5
C doesnʼt h"ve " boole"n d"t" type.5
0 me"ns f"lse, everything else is true
Arr"ys -> int d"ys[7];
Or int d"ys[] = {0,1,2,3}
C does not h"ve " type for strings. Inste"d we use ch"r "rr"y.5
In j"v" we h"ve cl"sses. In C we h"ve functions.5
In C we h"ve function definitions
Unlock document

This preview shows half of the first page of the document.
Unlock all 2 pages and 3 million more documents.

Already have an account? Log in

Get OneClass Notes+

Unlimited access to class notes and textbook notes.

YearlyBest Value
75% OFF
$8 USD/m
$30 USD/m
You will be charged $96 USD upfront and auto renewed at the end of each cycle. You may cancel anytime under Payment Settings. For more information, see our Terms and Privacy.
Payments are encrypted using 256-bit SSL. Powered by Stripe.