AP Notes, Outlines, Study Guides, Vocabulary, Practice Exams and more!

ap Flashcards

Terms : Hide Images
7576039202pointervariable that stores a memory address0
7576064484& operator for pointersreferences a value, ie gets the memory address for a variable1
7576073114int x = 5; int *p = &x; printf("%d",*p)52
7576107371int x = 5; int *p = &x; printf("%d",*p) *p=9 printf("%d",x)93
7585717046Stack variablesonly exist inside of their scope/function4
7585719745static variablesexists in function, retains value after successive calls5
7585754204global variblestype of static variable. can be referenced across files using "extern"6
7585793281* operator for pointersdeferences a pointer --> follows the pointer to get the thing it points to7
7585879080int a[3] = {0,1,2} int *p=a what is pp is a pointer to the first element in the array8
7585884361int a[3] = {0,1,2} int *p=a what's another way to write *p?&a[0]9
7585890636how to write a[2] with *p?*(p+2)10
7586005401char c[]={'a','b','\0'} char c[]="abc"11
7591852264char c[]="abc" , c points to"a"12
7591853830char c[]="abc" , is c incrementable?no. always points to a, you can do c[i] though13
7591858958char *s = "my string"s is a pointer to the first character. is incrementable14
7591873119declare array of stringschar *a={"hello","world"}15
7591989398valgrind commandvalgrind --leak-check=full ./executable16
7604286215argv[0]first argument of command line17
7605160650argc stands forargument count18
7605163900argv stands forargument vector19
7605171664argv is a pointer toan array of character strings, that contain arguments (one per string)20
7665791475gcc flags-g and -wall for all, -g for linking21
7665810478-l flag for lsmore info about each file22
7665813688-a flag for lsall files, including hidden23
7665823477steps for compilingpreprocessing, compiling, linking24
7665825497preprocessingeg, #include "file"25
7665829103compilingconverts c to lower level language, creates .o files26
7665833800linkingtakes several .o files and makes executable27
7665860963include guards#ifndef #define #endif28
7665863092compile a c programgcc -Wall -g -c main.c29
7665866188gcc flags for compiling-Wall -g -c30
7665876475-gadds debugging to tell you where code broke31
7665880040-Wallcompile time warnings`32
7665881218-cpreprocesses and compiles c33
7665883537how to linkgcc -g main.o -o main34
7665910983CFLAGScompiling flags, -g -Wall35
7665914899LDFLAGSlinking flags, -g36
7665916753dependencies for mainmain: myadd.o main.o37
7665922068implicit linking rule$(CC) $(LDFLAGS) $(LDLIBS)38
7665935011main.o line in makemain.o: main.c myadd.h39
7666109125data typeschar<= short <= int <=long <=long long40
7666158412size of char1 byte41
7666158413actual incrementvoid increment(int * b){ (*b)++ } increment(&a)42
7666181342p+1 vs *(p+1)p+1 is pointing to the thing after what p points to *(p+1) is the value of the thing next to what p is pointing to43
7666200082ways to declare stringchar c[]="abc" char c[]={'a','b','c','\0'} char *s="my string"44
7666270027mallocingint *p=(int *)malloc(100*(sizeof(int))45
7666318853char x = 0=0, char x = '\0' = 0 char x = '0' = 4846
7666353270bitwise and and or&, |47

Need Help?

We hope your visit has been a productive one. If you're having any problems, or would like to give some feedback, we'd love to hear from you.

For general help, questions, and suggestions, try our dedicated support forums.

If you need to contact the Course-Notes.Org web experience team, please use our contact form.

Need Notes?

While we strive to provide the most comprehensive notes for as many high school textbooks as possible, there are certainly going to be some that we miss. Drop us a note and let us know which textbooks you need. Be sure to include which edition of the textbook you are using! If we see enough demand, we'll do whatever we can to get those notes up on the site for you!