资源描述:
《C Reference Manual》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、-CReferenceManualDennisM.RitchieBellTelephoneLaboratoriesMurrayHill,NewJersey079741.IntroductionCisacomputerlanguagebasedontheearlierlanguageB[1].Thelanguagesandtheircompilersdifferintwomajorways:Cintroducesthenotionoftypes,anddefinesappropriateextrasyntaxan
2、dsemantics;also,ConthePDP-11isatruecompiler,producingmachinecodewhereBproducedinterpretivecode.MostofthesoftwarefortheUNIXtime-sharingsystem[2]iswritteninC,asistheoperatingsystemitself.CisalsoavailableontheHIS6070computeratMurrayHillandandontheIBMSystem/370a
3、tHolmdel[3].ThispaperisamanualonlyfortheClanguageitselfasimplementedonthePDP-11.However,hintsaregivenoccasionallyinthetextofimplementation-dependentfeatures.TheUNIXProgrammer'sManual[4]describesthelibraryroutinesavailabletoCprogramsunderUNIX,andalsotheproced
4、uresforcompilingprogramsunderthatsystem.``TheGCOSCLibrary''byLeskandBarres[5]describesroutinesavailableunderthatsystemaswellascompilationprocedures.Manyoftheseroutines,particularlytheoneshavingtodowithI/O,arealsoprovidedunderUNIX.Finally,``ProgramminginC-ATu
5、torial,''byB.W.Ker-nighan[6],isasusefulaspromisedbyitstitleandtheauthor'spreviousintroductionstoallegedlyimpenetrablesub-jects.2.LexicalconventionsTherearesixkindsoftokens:identifiers,keywords,constants,strings,expressionoperators,andotherseparators.Ingenera
6、lblanks,tabs,newlines,andcommentsasdescribedbelowareignoredexceptastheyservetoseparateto-kens.Atleastoneofthesecharactersisrequiredtoseparateotherwiseadjacentidentifiers,constants,andcertainoperator-pairs.Iftheinputstreamhasbeenparsedintotokensuptoagivenchar
7、acter,thenexttokenistakentoincludethelong-eststringofcharacterswhichcouldpossiblyconstituteatoken.2.1CommentsThecharacters/*introduceacomment,whichterminateswiththecharacters*/.2.2Identifiers(Names)Anidentifierisasequenceoflettersanddigits;thefirstcharacterm
8、ustbealphabetic.Theunderscore``_''countsasalphabetic.Upperandlowercaselettersareconsidereddifferent.Nomorethanthefirsteightcharactersaresig-nificant,andonlythefirstsevenforexternalidentifiers.2.