資源描述:
《Programming in C.pdf》由會員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在學(xué)術(shù)論文-天天文庫。
1、OxfordUniversityComputingServicesProgramminginCLanguagesl9.2/2TypographicalConventionsListedbelowarethetypographicalconventionsusedinthisguide.Namesofkeysonthekeyboardareenclosedinanglebrackets;forexamplerepresentstheEnter(orReturn)key.Twokeynamesenclosedinanglebracketsan
2、dseparatedbyaslash(forexample,)indicatethatthefirstkeyshouldbehelddownwhilethesecondispressed;bothkeyscanthenbereleasedtogether.Wheretwoormorekeysareeachenclosedinseparateanglebrackets(forexample,)eachkeyinthesequenceshouldbepressedinturn.Characterst
3、ypedinbytheuserareinlower-casenon-boldcharactersintypewriterfont.Otheroptionsandbuttonnamesareshowninlower-casenon-boldcharactersintypewriterfont.Pull-downmenuoptionsareindicatedbythenameoftheoptionenclosedinsquarebrackets,forexample[File/Print].Toselecttheoption[Print]fromthe[F
4、ile]menu:clickwiththemousebuttononthe[File]menuname;movethecursorto[Print];when[Print]ishighlighted,clickthemousebuttonagain.Wheremenuitemsorlargesectionsofoutputareincluded,theyareshownastheywouldbedisplayedonthescreen.Sectionsmarkedwitha?aremoreadvancedandcanbeomittedonafirstr
5、eading.ProgramminginCl9.2/2Contents1Introduction11.1AboutthisUserguide11.2WhyuseC?12AnExampleCProgram23VariablesandExpressions33.1VariableDeclaration33.2VariableTypes33.3VariableNames43.4Assignment53.5ArithmeticOperators63.6IncrementandDecrementOperators73.7CastOperators73.8Bitw
6、iseOperators?73.9PromotionsandConversions?83.10ParsingRules?103.11SymbolicConstantsandThePreprocessor114InputandOutput114.1FormattedOutput—printf114.2ConversionSpecifiers124.3LiteralConstants134.4FormattedInput—scanf154.5CharacterI/O—getchar&putchar164.6End-of-File175FlowofContr
7、ol175.1RelationalandLogicalOperators175.2ConditionalBranching—if185.3ConditionalSelection—switch195.4Iteration—while,for205.5LocalJumps—goto?215.6ShortCircuitBehaviour?225.7Problems225.8DeclaringArrayVariables235.9InitialisingArrayVariables246Functions256.1BuildingBlocksofProgra
8、ms256.2ReturnValue256.3FunctionParameters25Octo