New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here


by: Miss Willie Koch

ComputerSystems CSC8400

Miss Willie Koch
GPA 3.54


Almost Ready


These notes were just uploaded, and will be ready to view shortly.

Purchase these notes here, or revisit this page.

Either way, we'll remind you when they're ready :)

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

Class Notes
25 ?




Popular in Course

Popular in ComputerScienence

This 6 page Class Notes was uploaded by Miss Willie Koch on Wednesday October 28, 2015. The Class Notes belongs to CSC8400 at Villanova University taught by ThomasWay in Fall. Since its upload, it has received 18 views. For similar materials see /class/230568/csc8400-villanova-university in ComputerScienence at Villanova University.

Similar to CSC8400 at VU

Popular in ComputerScienence


Reviews for ComputerSystems


Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 10/28/15
C Primer Outline Overview comparison of C and Java Good evening Preprocessor Command line arguments Arrays and structures Pointers and dynamic memory What we will cover A crash course in the basics ofC Like Java like C Operators same as Java 1 l 7 Relationaland Lo cal lt gt lt y y 39 3232 11 Syntax sam 7 if 7 0 7 switch case 1 i 7 continue break dalalype char double Simple Data Types size values 1 7123 to 127 2 73276810 32767 4 2147433643 to 2147433647 4 2147433643 to 2147433647 4 34E738 7 digits 3 i7E7308 15 digits long Java programmer gotchas 1 int i fori 0 i lt 10 i NOT forint i 0 i lt 10 i Java programmer gotchas 2 Uninitialized variab es Java programmer gotchas 3 Error handling w h Wa11 compiler opllon No exceptions include ltstdiohgt Must look at return values int mainint argc charquot argv int i factorial i return 0 Good evening Breaking down the code include ltstdiohgt I include ltstdiohgt 1m mainint argc charquot argv print a greeting Include the contents of the file stdioh Case sensitive 7 lowercase onlv No semicolon at the end of line printf quotGood eveninglnquot int main return 0 5 goodev Good 5 The OS calls this function when the program starts runni ening evening I printfformatstring argl Prints out a string specified by the format string and the argume formatstring C Preprocessor Composed of ordinary characters not dafine AK 20 Copied unchanged into the output Conversion specifications start with Fetches one or more arguments For example char int mainint argc charquot argv printf 1dn MAX return 0 a chaz 85 int 3d flea a For more details man 3 printf After the preprocessor gcc 7E 1m mainint erge charquot argv printf 1dn 20 return 0 Conditional Compilation define csc2400 1m mainint erge charquot argv ifdef CSC2400 printfquotThe Systems Classn lse printfquotSome other Classnquot 39f return 0 After the preprocessor gcc 7E 1m mainint erge charquot argv printf quotThe System Clas sn return 0 Command Line Arguments 1 int mainint argc char argv argc Number of arguments including program name argv Array of chars that is an array of c strings 7 argv0 program name 7 argv12 first argument 7 argvargc 1 last argument Command Line Arguments 2 include ltstdiohgt 1m mainint erge charquot argv int i printfquot od argumentsnquot erge i lt argc i printfquot d snquot i argvi fori 0 return 0 Command Line Arguments 3 5 emd11ne The Systems Class 4 arguments o emd11he 1 The 2 Systars 3 Class Arrays 0 char foo80 An array of 80 characte rs a sizeof foo O X sizeofchar 80 xi 80 bytes 0 int bar40 An array of 40 integers a sizeof bar 40 X sizeofint 40 X4 160 bytes Structures Aggregate data mum mm mm m cm m 3112 n lt nu m mm as smcnlnn 1 m mull axqc than alqv l minim is m yams ndn ammm mamaqal39 xeunn n Pointers Pointers are variables that hold an address in memory That address contains another variable Memory layout and addresses 4300 4304 4308 4312 Using Pointers 1 float f data vari b e float faddr pointer variable V f faddr any oat 4300 4304 any address faddr Sf S address operator f faddr 4300 4304 Pointers made easy 2 faddr 32 indirection operator f faddr 4300 4304 float g faddr indirection g is now 32 f 13 but I g is still 32 faddr 43 00 4304 Function Parameters Function arguments are passed by value What is pass by value The called function is given a copy of the arguments What does this imply The called function can39t alter a variable in the caller function but its private copy Three examples Example 1 swapi void swap1 int a int b Q2 Let X3 after swapi xy int temp x y t a a b M b temp A2 x3 y4 Example 2 swap2 void swap2 1m a 1m b Q Let x3 y4 after 1m temp swap2ampxampy a x y a b b tanp Example 3 scanf include ltstdiohgt Q Why using pointers in scanf int main A We need to assign x the value to x scanf dnquot ampx printf odn x Dynamic Memory Java manages memory for you C does not C requires the programmer to explicitly allocate and deallocate me mor Unknown amounts of memory can be allocated dynamically during ru ntime with malloc and deallocated using free Not like Java No new No garbage collection You ask for n bytes Not a highlevel request such as I39d like an instance of class stringquot malloc Allocates memory in the heap Lives between function invocations Example Allocate an integer int iptr int mallocsizeofint Allocate a structure Istruct nane naneptr struct name mallocsizeofstruct name free Deallocates memory in heap Pass in a pointer that was returned by malloc 7 int ipt int malloc sizeof int free iptr Caveat don t free the same memory block twice


Buy Material

Are you sure you want to buy this material for

25 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Jim McGreen Ohio University

"Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

Amaris Trozzo George Washington University

"I made $350 in just two days after posting my first study guide."

Bentley McCaw University of Florida

"I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"

Parker Thompson 500 Startups

"It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.