Vous êtes sur la page 1sur 1

MyWhyU

0.3IntroductiontoC/C++
BYALEX,O NMAY27T H,2007

BeforeC++,therewasC

SetComplement
SetComplementandRelativeComplement

TheClanguagewasdevelopedin1972byDennisRitchieatBell
Telephonelaboratories,primarilyasasystemsprogramming
language.Thatis,alanguagetowriteoperatingsystemswith.
Richiesprimarygoalsweretoproduceaminimalisticlanguage
thatwaseasytocompile,allowedefficientaccesstomemory,
producedefficientcode,anddidnotneedextensiveruntime
support.Despitebeingafairlylowlevelhighlevellanguage,it
wasdesignedtoencouragemachineandplatformindependent
programming.

Cendedupbeingsoefficientandflexiblethatin1973,Ritchie
andKenThompsonrewrotemostoftheUNIXoperatingsystemusingC.Manypreviousoperatingsystemshadbeenwritten
inassembly.Unlikeassembly,whichtiesaprogramtoaspecificCPU,CsexcellentportabilityallowedUNIXtobe
recompiledonmanydifferenttypesofcomputers,speedingitsadoption.CandUnixhadtheirfortunestiedtogether,andCs
popularitywasinparttiedtothesuccessofUNIXasanoperatingsystem.
In1978,BrianKernighanandDennisRitchiepublishedabookcalledTheCProgrammingLanguage.Thisbook,whichwas
commonlyknownasK&R(aftertheauthorslastnames),providedaninformalspecificationforthelanguageandbecamea
defactostandard.Whenmaximumportabilitywasneeded,programmerswouldsticktotherecommendationsinK&R,
becausemostcompilersatthetimewereimplementedtoK&Rstandards.
In1983,theAmericanNationalStandardsInstitute(ANSI)formedacommitteetoestablishaformalstandardforC.In1989
(committeestakeforevertodoanything),theyfinished,andreleasedtheC89standard,morecommonlyknownasANSIC.
In1990theInternationalOrganizationforStandardizationadoptedANSIC(withafewminormodifications).ThisversionofC
becameknownasC90.CompilerseventuallybecameANSIC/C90compliant,andprogramsdesiringmaximumportability
werecodedtothisstandard.
In1999,theANSIcommitteereleasedanewversionofCcalledC99.Itadoptedmanyfeatureswhichhadalreadymade
theirwayintocompilersasextensions,orhadbeenimplementedinC++.
C++
C++(pronouncedseeplusplus)wasdevelopedbyBjarneStroustrupatBellLabsasanextensiontoC,startingin1979.
C++addsmanynewfeaturestotheClanguage,andisperhapsbestthoughtofasasupersetofC,thoughthisisnotstrictly
trueasC99introducedafewfeaturesthatdonotexistinC++.C++sclaimtofameresultsprimarilyfromthefactthatitis
anobjectorientedlanguage.Asforwhatanobjectisandhowitdiffersfromtraditionalprogrammingmethods,well,well
coverthatinchapter8(Basicobjectorientedprogramming).
C++wasratifiedin1998bytheISOcommittee,andagainin2003(calledC++03).TwoupdatestotheC++language
(C++11andC++14,ratifiedin2011and2014accordingly)havebeenmadesincethen,addingadditionalfunctionalitytothe
language.Relevantfeaturesfrombothoftheseupdateswillbediscussedinthesetutorials.
CandC++sphilosophy
TheunderlyingdesignphilosophyofCandC++canbesummedupastrusttheprogrammerwhichisbothwonderful,
becausethecompilerwillnotstandinyourwayifyoutrytodosomethingunorthodoxthatmakessense,butalsodangerous,
becausethecompilerwillnotstandinyourwayifyoutrytodosomethingthatcouldproduceunexpectedresults.Thatisone
oftheprimaryreasonswhyknowingwhatyoushouldntdoinC/C++isalmostasimportantasknowingwhatyoushoulddo
becausetherearequiteafewpitfallsthatnewprogrammersarelikelytofallintoifcaughtunaware.
NotethatyoudonothavetolearntoprograminCbeforedoingthesetutorials.Wellteachyoueverythingyouneedtoknow

Vous aimerez peut-être aussi