C Programming: Identifiers, Linkage, and Storage Classes, Study notes of Computer Science

An introduction to the c programming language, focusing on identifiers, linkage, and storage classes. Topics covered include the difference between external and internal linkage, static and automatic storage classes, and the use of static variables. The document also touches upon the c compiler and its options, as well as pointers and argument arrays.

Typology: Study notes

Pre 2010

Uploaded on 03/16/2009

koofers-user-95y
koofers-user-95y 🇺🇸

10 documents

1 / 30

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS241
Introduction To C
Lawrence Angrave
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e

Partial preview of the text

Download C Programming: Identifiers, Linkage, and Storage Classes and more Study notes Computer Science in PDF only on Docsity!

CS

Introduction To C Lawrence Angrave

Crash course in C

char * search(char*) { char result[100]; … do stuff return result; }

static int debug=1; main(…) { }

Linkage & Scope

Linkage

Identifiers (variables & functions) visible to another c file? Main.c = Compilation unit Myutils.c = Another compilation unit Static : No!

main.c

Refer to runsuperfast and die? extern int runsuperfast; void die(char *mesg);

main.c

Refer to runsuperfast and die? void die(char *); // declaration! extern int runsuperfast;

C Compiler

gcc Gnu Compiler

Many options! man gcc Three for the price of one Preprocessor Compiler Linker

Pointers

Pointers

How to shoot yourself in the foot and not realize it

int *p

What is the value of p == &*p; p[0] == *p

char **argv

Explain this to your neighbor