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

Computer Science I

by: Luisa Beer

Computer Science I COP 3502

Luisa Beer
University of Central Florida
GPA 3.78


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 Computer Programming

This 2 page Class Notes was uploaded by Luisa Beer on Thursday October 22, 2015. The Class Notes belongs to COP 3502 at University of Central Florida taught by Staff in Fall. Since its upload, it has received 45 views. For similar materials see /class/227474/cop-3502-university-of-central-florida in Computer Programming at University of Central Florida.

Similar to COP 3502 at University of Central Florida

Popular in Computer Programming


Reviews for Computer Science I


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/22/15
C Reference Card ANSI Program StructureFunctions type fnctype1 V V function declarations type name main ine declaratlons local variable declarations statements type fncargl V v function de nition declaratlons local variable declarations statements eturn yalne comments mainint argc char argv D main with ar s exit arg terminate execution C Preprocessor include library le include lt lenamegt include quot lenamequot define name text replacement macro d nameyar text Example define maXAB AgtB 7 A l 3 un e ne undef name quoted string in replace it if else elif endif i on is name de ned not de ned fdef ifndef name de ned def ined name line continuation char Data TypesDeclarations character 1 byte char integer in oat single precision float oat double precision double short 16 bit inte er s or long 32 bit integer long positive and neg e signed only positive igned pointer to int float tint float H enumeration constant enuin constant unchanging value const declare external variable register variable register local to source le static Void structure struct create name by data type typedef typename size of an object type is sizeit sizeof 0b39ect size of a data type type is sizeit sizeof type name Initialization initialize variable initialize array initialize char string type nameyalne type name Ualne1 V V char name quotstrlngquot 1999 Joseph H Silverman Permissions on back v1 3 external variable declarations Constants long suf x newline cr tab backspace special characters string constant ends with 39039 n r 7 39 quot quotabc d Pointers Arrays 8 Structures declare pointer to t e name declare function returning pointer to type type f declare pointer to function returning t generic pointer type null pointer object pointed to by polnter address of object name arra multiedim array Structures struct tag declaratlons l create structur ember of structure from template member of pointed to structure ype type pf Void tpolnter ampname name dtm name dlmll dlmg H structure template declaration of members struct tag name namemember pointer 7 member Example P x and pigtx are the same single value multiple type structure bit eld with b bits ion member b Operators grouped by precedence structure member operator structure pointer name member pointer member increment decrement lus minus logical not bitwise not H W indirection via pointer address of object tpolnter ampname ty cast expression to type pe expr size of an object zeof multiply divide modulus remainder t 397 add subtract 7 left right shift bit ops ltlt gtgt comparisons gt lt lt comparisons bitwise and amp bitwise exclusive or bitwise or inc I logical and ampamp logical or I I conditional expression assignment operators expression evaluation separator exprl exprg exprg 7 7 Unary operators conditional expression and assignment opere ators group right to left all others group left to right Flow of Control statement terminator block delimeters exit from switch while do for next iteration of while do for go label return value from function Flow Constructions if statement else if expr else statement while statement while expr for statement do statement do statement while expr switch statement break c ont inue got 0 la bel la bel return expr if expr statement statement for exprl exprg exprg statement switch expr statementl break statementg break default statement ANSI Standard Libraries float hgt ltsetjmphgt ltsignalhgt ltstdarghgt limits hgt ltstddefhgt ltstdiohgt ltstdlibhgt ltstringhgt lttimehgt Character Class Tests ltCtype hgt al hanurneric alphabetic control character decimal digit printing character not incl space lower case letter printing character incl space printing char except space letter digit space formfeed newline cr tab vtab convert to upper case toupper c String Operations ltstringhgt st are strings csct are constant strings length of s copy ct to s n chars concatenate ct after s up to n chars pointer to rst c in cs pointer to last c in cs copy n chars from ct to s copy n chars from ct to s may overlap compare n chars of cs with ct pointer to rst c in rst n chars of cs put c into rst n chars of cs strchrcs strrchrcsc CPysct n memsetsc n C Reference Card ANSI InputOutput ltstdiohgt standard output stream stdout standard error stream st e end 0 EUF get a character getchar r a ac utchar 0hr print formatted data printfquotf0rmat quot argl v print to string s sprintf squotf0rmatquot argl read formatted data scanf quotformat quot miamel read from string sscanfs quotformat quot miamel v v read line to string s lt max chars getssmax print string s puts s File I 0 declare le pointer E fp pointer to named le fopenquotname quot quotmodequot modes r read w Write a append get a character getc fp Write a character putc 0hr fp Write to le fprintf fp quotformatquot argl read from le fscanf fp quotformatquot argl v close le c o nonezero if error f error fp nonezero if EOF 0f fp read line to string s lt max chars fgetssmaxfp Write strin s fputss fp Codes for Formatted IO quot397r 0wpmcquot left justify print With sign space print space if no si 0 pad With leading zeros 21 min eld Width 10 precision m conversion character h short 1 long L long double 0 conversion character i integer u unsigned single char s char string f double eE exponential o octal xX hexadecimal p pointer n number of chars Written gG same as f or eE depending on exponent Variable Argument Lists ltstdarg hgt declaration of pointer to arguments list name initialization of argument pointer vastartmzme lastarg astarg is last name parameter of the function access next uname arg update pointer aargname type v call before exiting function Vaendname Standard Utility Functions ltstdlibhgt absolute value of int n abs n absolute value of long n labs n quotient and remainder of ints nd divnd retursn structure With divt quot and d1vt rein quotient and remainder of longs nd ld1Vnd pseudoerandom integer 0 RANDJ IAX set random seed to n srandn terminate program execution exit status pass string s to system for execution systems Conversions convert string s to double atofs convert string s to integer atoi s convert string s to long atols strtodsendp strtolsendpb convert pre x of s base b to long s strtoulsendpb ut unsigned long Storage Allocation malloc size calloc nobj size realloc pts size deallocate space freeptr bsearch key array n size cmp 0 sort array ascending order qsort array nsizecmp Time and Date Functions lttime hgt processor time used by program clock Example clockCLUCKSPERSEC is time in seconds current calen ar time time timegitimel in seconds double difftimetime2 timel arithmetic types representing times clockt timet structure type for c en ar time comps tin s in ec seconds after minute tminin minutes after hour tin our hours since midnig t tmmday day of mo tminon months since January tmyear years since 1 tmwday days since Sunday tmyday days since J tmisdst Daylight Savings Time ag convert local time to calendar time mktimetp convert time in tp to string asctime tp convert calendar time in tp to local time ctime tp convert calendar time to GMT gmtimetp convert calendar time to local time localtimet P format date and time info strftimessmax quotformat quot tp tp is a pointer to a structure of type in Mathematical Functions ltmathhgt Arguments and returned values are double trig functions sinX cosx tanX inverse trig functions asinx acosx atanX arctan y ac hyperbolic trig functions exponenti s ogs exponentials amp logs d a an2 yx sinhx coshx tanhx expx logx log10x 2 power ldexpxn frexpxe r division amp remain e modf xip fmodxy powers ow xy s rtx rounding ceilx floorx fabsx 5 Integer Type Limits ltlimitshgt The numbers given in parentheses are typical values for the constants on a 32bit Unix sys em CHAR BIT bits in char 8 CHARJ IAX max value of char 127 or 255 CHARJ IIN min value of char 7128 or O INTJ IAX max value of int 32767 INTMIN min value of int 732 768 2147483647 4147483648 SCHARJ IIN min value of signed char 7128 SHRTJ IAX max value of short 32767 SHRTMIN min value of sho 732768 UCHARJ IAX max value of unsigned char 255 UINT MAX max value of unsigned int 65535 ULUNG MAX max value of unsigned long 4294967295 USHRTJ IAX max value of unsigned short 65536 Float Type Limits ltfloat hgt FLTRADIX radix of exponent rep 2 FLTROUNDS oating point rounding mode FLT D I G decimal digits of precision 6 FLTEPSILON smallest 00 so 10 00 at 10 105 FLTMANTDIG number of digits in mantissa FLT AX maximum oating point number 1037 FLTMAXEXP maximum exponen FLT I minimum oating point number 10737 FLTMINEXP minimum exponen DBLDIG decimal digits of precision 10 DBLEPSILON smallest 00 so 10 00 at 10 10quot DBLMANTDIG number of digits in mantissa DBLMAX max double oating point number 1037 DBLMAXEXP maximum exponen DBLMIN min double oating point number 10737 DBLMINEXP minimum exponent May 1999 y1 3 Copyright 1999 Joseph H Siiyerman Permission is granted to make and distribute copies of this card pror yided the copyright notice and this permission notice are preserved on all copies Send comments and corrections to J H Siiyerman Math Dept Brown Uniy Providence R102912 USA jhsmath brown edu 6


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."

Jennifer McGill UCSF Med School

"Selling my MCAT study guides and notes has been a great source of side revenue while I'm in school. Some months I'm making over $500! Plus, it makes me happy knowing that I'm helping future med students with their MCAT."

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!"


"Their 'Elite Notetakers' are making over $1,200/month in sales by creating high quality content that helps their classmates in a time of need."

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.