467AppendixAnswerstoExercisesThisappendixfeaturestheanswerstotheexercisesinthebackofeachchapter.
Chapter3wasthefirstchaptertofeatureexercises,sothat'swherewestart.
Chapter31.
ThisscreenshotshowstheerrorwegotwhenwechangedSayHello();toSayHello(;.
APPENDIX:AnswerstoExcercises4682.
ThisscreenshotshowstheerrorwegotwhenwechangedmaintoMAIN.
Thelinkerfailsbecauseeveryprogrammusthaveafunctionnamedmain(),andnowyoursdoesn't.
3.
Thisscreenshotshowstheerrorwegotwhenwedeletedtheleftcurlybracethatopensthemain()function.
APPENDIX:AnswerstoExcercises4694.
ThisscreenshotshowstheerrorswegotwhenwechangedthecaseoftheSayHello()functionprototype.
Chapter41.
Findthemistakeineachofthefollowingcodefragments:a.
Thequotesaround"Hello,World"aremissing.
b.
Thecommabetweenthetwovariables(myIntandmyOtherInt)ismissing.
c.
=+shouldbe+=.
d.
Thesecondparametertoprintf()ismissing.
Eachformatspecifierinthefirststringmustbematchedwithanappropriatevariableintheparameterlist.
e.
Here'sanotherruntimeerror.
Thistime,youaremissingthe%dinthefirstargumenttoprintf().
Thiswon'tcauseanyproblems(themyIntvalueissimplyignored),butit'sprobablynotwhatyouintended.
f.
Thistime,you'veeithergotanextra\oraremissingannfollowingthe\inthefirstprintf()parameter.
g.
Theleft-handandright-handsidesoftheassignmentareswitched.
Thevariablebeingassignedisalwaysontheleft.
h.
ThedeclarationofanotherIntismissing.
Thecompilerdoesn'tknowwhatanotherIntis.
APPENDIX:AnswerstoExcercises4702.
ComputethevalueofmyIntaftereachcodefragmentisexecuted:a.
70b.
-6c.
-1d.
4e.
-8f.
2g.
14h.
1Chapter5AftersteppingthroughtheHello3project:1.
Thedebuggerstoppedatbreakpointsatotaloffourtimes.
2.
Thedebuggerstoppedbeforetheprintf()statementthreetimes,onceforeachtimethedebuggerstoppedatbreakpointsatotaloffourtimes.
3.
Themain()functionexecutedonce,andthedebuggerstoppedforthebreakpointinmain()once.
TheSayHello()functionwasexecutedthreetimes,andthedebuggerstoppedforthebreakpointinthatfunctioneachtime,foratotaloffourbreaks.
Chapter61.
What'swrongwitheachofthefollowingcodefragmentsa.
Anifstatement'sexpressionmustbesurroundedbyparentheses.
b.
Weincrementiinsidetheforloop'sexpressionandthendecrementitinthebodyoftheloop.
Thisloopwillneverend!
APPENDIX:AnswerstoExcercises471c.
Thewhileloophasparenthesesbutismissinganexpression.
d.
Thedostatementshouldfollowthisformat:dostatementwhile(expression);e.
Eachcaseinthisswitchstatementcontainsatextstring,whichisillegal.
Also,casedefaultshouldreaddefault.
f.
Theprintf()willnevergetcalledbecauseifiislessthan20,thenitcan'tpossiblybeequalto20.
g.
ThisisprobablythemostcommonmistakemadebyCprogrammers.
Theassignmentoperator(=)isusedinsteadofthelogicalequalityoperator(==).
Sincetheassignmentoperatorisperfectlylegalinsideanexpression,thecompilerwon'tfindthiserror.
Thisisanannoyinglittleerroryou'llencounteragainandagain!
h.
Onceagain,thiscodewillcompile,butitlikelyisnotwhatyouwanted.
Thethirdexpressionintheforloopisusuallyanassignmentstatement-----somethingtomoveitowarditsterminatingcondition.
Theexpressioni*20isuselesshere,sinceitdoesn'tchangeanything.
2.
Lookinthefolder06.
E2-NextPrime2.
3.
Lookinthefolder06.
E3-NextPrime3.
Chapter71.
Predicttheresultofeachofthefollowingcodefragments:a.
Thefinalvalueis25.
APPENDIX:AnswerstoExcercises472b.
Thefinalvalueis512.
Trychangingtheforloopfrom2to3.
Noticethatthisgeneratesanumbertoolargefora2-byteshorttohold.
Nowchangetheforloopfrom3to4.
Thisgeneratesanumbertoolargeforevena4-byteinttohold.
Beawareofthesizeofyourtypes!
c.
Thefinalvalueis1,024.
2.
TheexpressionisPrimeisnotrecognized,becausethescopeofavariableendswiththeblockofcodeitwasdeclaredin.
3.
Lookinthefolder07.
E3–Factor2.
Chapter81.
What'swrongwitheachofthefollowingcodefragmentsa.
Thechartypedefaultstosigned,soccanonlyholdvaluesfrom-128to127.
Itwouldbebettertouseanint.
b.
Use%f,%g,or%etoprintthevalueofafloat,not%d.
Also,thevariablebeingprintedisf.
ItshouldbemyFloat.
c.
Acharacterconstantissurroundedbysinglequotes,notdoublequotes.
Thetextstring"a"isanarraycomposedoftwocharacters:'a'andtheterminating'\0'char.
Thevariablecisonlyasinglebyteinsize.
Evenifcwere2byteslong,youcouldn'tassignapointertoaninteger.
Trycopyingthetextonebyteatatimeintoavariablelargeenoughtoholdthetextstringanditsterminatingzerobyte.
d.
Onceagain,thiscodeusesthewrongapproachtocopyingatextstring.
Also,evenifthecharactersinthestringwerecorrectlycopiedintoc,thecarrayisnotlargeenoughtoholdthattextstringanditszerobyte.
e.
A#definedirectiveisnotaCstatementanddoesnotendwithasemicolon(unlessyouwantasemicolontobeincludedinthereplacementtext).
APPENDIX:AnswerstoExcercises473f.
The#defineofkMaxArraySizemustcomebeforethefirstnon-#definereferencetoit.
g.
Thisarraydefinition(charc[kMaxArraySize])createsanarrayrangingfromc[0]toc[kMaxArraySize-1].
Thereferencetoc[kMaxArraySize]isoutofbounds.
2.
Lookinthefolder08.
E2–Dice3.
3.
Lookinthefolder08.
E3-Overflow.
Chapter91.
Lookinthefolder09.
E1-SeeArgs2.
2.
''LearnContheMac!
''Ifyouwanttostepthroughtheprogram,lookinthefolder09.
E2-Message.
3.
Lookinthefolder09.
E3-WordCount2.
Chapter101.
What'swrongwitheachofthefollowingcodefragmentsa.
ThekeywordstructbeforeLinkismissinginthedeclarationofthenextfield.
b.
Youcan'tdeclareafieldofastructtobeacopyofitself.
It'smorelikelythattheseshouldbepointerstosimilarstructs,inwhichcasethecorrectsyntaxisstructLink*next.
c.
WhilethisisperfectlyvalidCcode,itwillneveroutputanything.
Thewhileloopadvancesthelinepointeruntilitpointstoa'\0'character.
Itthenprintsthisvalueusingprintf(),butsincelinealwayspointstoa'\0'nothingisoutput.
2.
Lookinthefolder10.
E2-DVDTracker2.
3.
Lookinthefolder10.
E3-DVDTracker3.
APPENDIX:AnswerstoExcercises4744.
Lookinthefolder10.
E4-DVDTracker4.
Chapter111.
What'swrongwitheachofthefollowingcodefragmentsa.
Theargumentstofopen()arebackwards.
Thefirstargumentisthepathtothefile,andthesecondisthemode.
b.
Thefirstparametertofscanf()containsaprompt,asifyouwerecallingprintf().
Thefirstparameteroffscanf()istheFILEpointer.
c.
lineisdeclaredasacharpointerinsteadofasanarrayofchars,thepointerisuninitialized,andnomemorywasallocatedforthestringbeingreadinbyfscanf().
Also,sincelineisapointer,the&inthefscanf()callshouldn'tbethere.
d.
Thiscodeisfineexceptfortwoproblems.
Thefileisopenedforwriting,yetwearetryingtoreadfromthefileusingfscanf();thiswillfail.
Also,thereisnoprotectionagainstreadingmorethan99charactersintothelinearray.
2.
Lookinthefolder11.
E2-FileReader.
Chapter121.
Thefscanf()functionreturnsthenumberofvaluessuccessfullyscanned,orEOF.
TheifstatementonlytestsforEOFandassumestheconversionwassuccessfulotherwise.
Thecorrecttestshouldbeif(fscanf(fp,"%d",value)!
=1)todetermineiftheconversionwassuccessfulornot.
2.
Writeanassertstatementtoensureeachassumptionistrue.
a.
assert(dvdInfoPtr!
=NULL);b.
assert(count!
=0);c.
assert(argc>=1);APPENDIX:AnswerstoExcercises475d.
assert(str!
=NULL);assert(copyOfString!
=NULL);e.
assert(index>=0&&indexaddressofmyCatiscasttoastruct.
Instead,theaddressshouldbecasttoapointertoastruct(structDog*).
b.
ThetypedefdefinesFuncPtrtobeapointertoafunctionthatreturnsanint.
MyFunc()isdeclaredtoreturnapointertoanint,notanint.
c.
ThedeclarationofmyUnionismissingthekeywordunion.
Unlessyouuseatypedef,unionsandstructsaredeclaredusingatag.
Atagmustalwaysbeusedinconjunctionwiththeunionorstructkeyword.
Here'sthecorrecteddeclaration:unionNumbermyUnion;d.
ThePlayerunionfieldsmustbeaccessedusingu.
InsteadofmyPlayer.
myInt,refertomyPlayer.
u.
myInt.
InsteadofmyPlayer.
myFloat,refertomyPlayer.
u.
myFloat.
e.
First,myFuncPtrisnotafunctionpointerandnotalegall-value.
Asis,thedeclarationjustdeclaresafunctionnamedmyFuncPtr.
Thisdeclarationfixesthatproblemint(*myFuncPtr)(int);.
Next,main()doesn'ttakeasingleintasaparameter.
Besidesthat,callingmain()yourselfisaquestionablepractice.
Finally,tocallthefunctionpointedtobymyFuncPtr,useeithermyFuncPtr();or(*myFuncPtr)();,insteadof*myFuncPtr();.
2.
ChooseaCoreFoundationcollectionthatbestfitsthedata.
APPENDIX:AnswerstoExcercises476a.
Array.
Thenamesoftheweekareasequencewhichonewouldnaturallyaddressusingadaynumber(0forSunday,1forMonday,andsoon).
b.
Set.
URLsthatyouwanttovisitdon'thaveanyparticularorder,andyoudon'twantthemduplicatedinthecollectionifyouaddthesameURLmorethanonce.
c.
Tree.
Theorganizationofspeciesformsahierarchy,whichisperfectlysuitedfortrees.
d.
Dictionary.
Adictionarycaneasilymaplockernumbers(thevalue)withmembernames(thekey).
e.
Bag.
Likeset,abagstoresunorderedvalues.
Unlikeaset,abagcancontainduplicatevalues.
Thispermitsaperson'snametobeaddedtothebagmorethanonce,andthusbeenteredintotherafflemorethanonce,improvingtheirodds.
477IndexNumbersandSymbols&operator,144*operatoraddress,149assignmentstatement,146debugger,150dereferences,149gamechanger,146memoryallocation,147,148valueassignment,149,150,(comma)operator,437^operator,435|operator,435~(bitwisenot)operator,436AAbsolutepath,244Apple'sXcodecost,2foldercontents,6installation,1–2newprojectassistant,7projectfiles,4projecttemplateoptions,8registereddeveloper,3runningaproject,10startupwindow,4,5workspacewindow,6,9aproposcommand,234Archivecommand,241argcandargvvalues,237Arguments,156–157ArgumentsPassedonLaunch,239Arrayinitializer,282ASCII.
xcodeprojconvertedDigit,200lowercaseRomanalphabet,200printableASCIIcharacter,199sourcecodemain()calls,203PrintChars(),202printf(),203putchar(),203sumOfChars,199unprintables,200–202Assignmentoperator(=),51Auto-completionfeature,249Automaticvariable,156,172Average()function,157–158,165BBinarymultiplicationoperator,151Binaryoperators,436Booleanalgebra,99breakstatement,125Bug,76Buildsettings,242Ccalloc(),315camelCase,46Castoperator,417cd(changedirectory)command,246INDEX478Cfunctionscallingafunction,25–26casesensitive,37–39consolepane,22declaration,23Hello2projecteditorpane,29programrunning,32projectnavigator,29sourcecode,30–32toolbar,29workspacewindow,29issuedetailandfixingit,36mail-sortingflowchart,24main.
ccomment,27functiondeclaration,27#includefile,27returnstatement,27semanticerror,24StandardLibrary,33syntaxerrors,23,35,37chararray,332CocoaandCocoaTouch,457Commandlinecharacterinputinteractivecharacterstreams,253Namer.
xcodeproj(seeNamer.
xcodeproj)nullfile,255otherprocesses,255–256pipes,252–253pipestofiles,254commandarguments,232command-lineinterface,287command-linetoolcommandargumentsandmain(),237–238installing,250PATHvariableconfiguration,251–252privatebindirectorycreation,250SeeArgs.
xcodeproj,238–240deployingprogram,241–244manpage,233–234pointerarithmeticcomparingpointers,264pointeraddition,265–268pointerequivalence,267subtractingpointers,268RomanNumeral.
xcodeproj(seeRomanNumeral.
xcodeproj)shellprogram,230–231,235–236terminalwindow,230tersenessof,257usingpathsabsolutepath,244currentdirectoryandrelativepaths,245–246homedirectoryname,248pathseparator,244specialdirectorynames,246–248WordCount.
xcodeproj(seeWordCount.
xcodeproj)Command-lineinterface,287Compoundexpressions,102–103Compoundstatements,106Conditionaloperators,270–271constmodifier,419–420continuestatement,125–126Coperatorsand%=operators,54–56++and--operators,53+=and-=operators,54addition(+)andsubtraction(-)operators,52assignmentoperator(=),51precedenceof,57–59usingparentheses,56CoreFoundationframeworkarray,446INDEX479bag,446dictionary,446FavoriteDVDs.
xcodeproj,447,448FavoriteSetCompareItems(),450FavoriteSetItemHashCode(),450–452main(),448–450set,446tree,446Countdown()function,173CountWords(),275–277Cprogrammingcommentoutstatements,70–71commentedcode,69–70constmodifier,419–420creatingowntypesexample,421forwardreferences,422–423structtypedefs,422curlybraceplacement,71enumeratedtypes,423–425functionpointers,433–435Operator.
xcodeprojoutput,60projectwindow,60sourcecode,61–64Postfix.
xcodeoutput,64sourcecode,65–66recursioniterativeapproach,429recursiveapproach,430–433remainingoperators,435–437typeconversionconversionrules,413–415conversionwarnings,415definition,411example,411implicitconversion,412trickledowneffect,413typecastingcastoperator,417example,416explicitconversion,416pointers,417–419unions,425–428whitespace,67–69Cshell(csh),231Cstatements,21Curlybraces,71Cvariablesbytesandbitsbit-numberingscheme,481byteto2bytes,50–51bytevalue,49two'scomplementnotation,49datacontainers,43,44declarationof,45typesize,47–48variablenames,45–47DDatastructuresbundlingdata,291DVDmyInfo,301rating,301struct,301StructSize.
xcodeproj(seeStructSize.
xcodeproj)DVD'sattributesChar,292#defines,292floats,292,293kMaxTitleLength,293myArray[0],293rating,292trackingarrays,293DVDTracker.
xcodeproj(seeDVDTracker.
xcodeproj)linkedlistscreation,318–319masterpointer,317INDEX480Datastructures(cont.
)memoryallocationAddress!
tracking,316,317free(),315malloc()(seemalloc())MultiArray.
xcodeprojblap,297#define,294dvdNum+1,296fgets(),297#include,295#include,299kMaxDVDs,296PrintDVDTitle()function,295,297–299printf(),294,295title[0][0],297titlearraysize,294ParamAddress.
xcodeproj,309–311structadvantageanddisadvantage,309#definekMaxDVDs,311DVDInfostructdeclaration,307main(),308myDVDPtr->rating,308myDVDs[10].
rating,311myInfofields,307PrintDVD(),307,308DatatypesarrayscharmyChar[20]\,204Dice.
xcode(seeDice.
xcode)exceedingtheboundsofyourarray,210floatsalaries[50]\,205intmyNumber[3]\,204myNumber,205charactersASCIICharacterSet,197–198ASCII.
xcodeproj(seeASCII.
xcodeproj)#defineDirectiveadvantagesof,214–216code,212–213function-like#defineMacros,216–217kDiceSides,210kMaxArraySize,211,212MAX_ARRAY_SIZE,212pound-define,210preprocessor,213–214FloatSizer(seeFloatSizer)integertypes(seeIntegertypes)ints,177exact-widthtypes,195IMPLICITConversion,192–193inadequaterange,190–191integervs.
floatingpoint,196–197rangesof,190semantictypes,195signconversion,193–194IntSizer.
xcodeproj,188–189myNum,178textstringsFullName.
xcodeproj(seeFullName.
xcodeproj)inmemory,217–218Overflow.
xcodeproj(seeOverflow.
xcodeproj)Debugarea,79Debuggingdefinition,76executioncontrolHello3project,77runningprogram,fullspeed,85–87settingbreakpoints,78–80steppingintofunction,81–84steppingoutfunction,84–85steppingoverstatement,80–81INDEX481iceberg,90OperatorsandPostfixprojects,75origins,76–77variablesexaminationargvandargc,88inspectorpop-up,89myInt,88,89OperatorsDBprojectworkspace,87OperatorsDBstoppedatbreakpoint,88OperatorsDB.
xcodeproj,87printf()statement,90StepOverbutton,89Dice.
xcodeoutputof,206sourcecodefunctionprototypes,207#includes,207main(),207PrintRolls(),208PrintX(),209rand(),208RAND_MAX,208RollOne(),208srand(),207twoDice,208DinoEdit.
xcodeprojdinosaurnumber,360GetNewDinoName,364GetNumber(),363GetNumberOfDinos(),364–365kDinoFileName,361kDinoRecordSize,361kMaxLineLength,361main(),362–363main.
c,361MyDinos.
data,360ReadDinoName(),365–366TrimLine(),367WriteDinoName(),366–367Documentationbrowser,39,40dostatement,119–120DVDFiler.
xcodeprojDVDData.
txtexploration,345–346DVDFile.
c,353–354DVDInfo.
h,351–352DVDInfostructs,343,344main.
c,349–351modularcode,344–345newsourcecodefile,348–349projectwindow,343ReadFile(),355–356ReadStructFromFile(),356–357running,346–348WriteFile(),343,354–355DVDTracker,331,343DVDTracker.
xcodeprojDVDrating,320DVDtitle,320Entercommand,320sourcecodeAddToList(),325ctype.
h,321DVDInfostructdeclaration,321dvdTracker.
h,321GetCommand(),323ListDVDs(),326main(),322–323main.
C,321ReadStruct(),324–325stdio.
h,321string.
h,321TrimLine(),327–328Eechocommand,251Editschemedialog,239Endoffile(EOF),332Enumeratedtypes,423–425errno,392–394Errorhandlinganticipation,407–409INDEX482Errorhandling(cont.
)assumptionsassertstatements,388–490Factor()function,386fgets(),387ranges,385–386variables,383–384escapeplanearlyreturn,397–398exceptionhandling,403exit,stageleft,402–403followthesuccess"pattern,395–397longjmp(),404percolateerrorsup"pattern,401–402ReadFile()function,403ReadOneField()function,405ReadStructFromFile(),404,405setjmp()function,403skippastfailure"pattern,398–401Murphy'slaw,382–383returnvalueschdir(),391errno,392–394getpwuid(),391SetHomeDirectory(),391Explicitconversion,416FFactor()function,161–162,165Factorialproblem,430–433Factorprogram,169Factor.
xcodeproj,163–165FALSEconstant,98Filesbytes,332chararray,332datafile,332endoffile(EOF),332manipulationDinoEdit.
xcodeproj(seeDinoEdit.
xcodeproj)endians,369–371randomaccessfunctions,359randomfileaccess,359textvs.
datafiles,368–369updatemodes,358names,332–333offset/positionaddress,332openingandclosing,333–335PrintFile.
xcodeproj(seePrintFile.
xcodeproj)reading,335–337RomanNumeraltool(seeRomanNumeral.
xcodeproj)systemobjects,378–379writingDVDFiler.
xcodeproj(seeDVDFiler.
xcodeproj)fprintf(),342fputc(),342fputs(),342putchar(),342Filesystem,332Firstin,firstout(FIFO)buffer,260FloatSizerformatspecifiermodifiersapproximation,182fixedaccuracy,183(%f)specifiers,182mantissaorcoefficient,183printf()s,181–183significand,183specifier%,184outputof,178,179scientificandgeneralspecifiersdoublehangs,185%gspecifier,184printf(),184sourcecode#include,179myDouble,181INDEX483myLongDouble,179,181printf()function,180,181size_t,180sizeof,180forstatementcompilerwarnings,116execution,114–115infiniteloop,113initialization,113lonelieststatement,115LoopTester.
xcodeproj,116–119modification,113semicolon,115termination,113Forwardreferences,422–423fread(),365,366Free-formlanguage,68fseeko(),365,366ftello(),365FullName.
xcodeprojPrintFullName()function,219printf()function,222strcat(),221,222strcpy(),220headerfile,219FunctionparametersAddTwo(),152vs.
arguments,156–157globalvariablesaddition,171–172datasharing,169definition,169parameterpassing,170usage,170–171pointersas,161–162returnvalueAverage()function,157–158main()function,157multiplereturnstatements,159–160printf(),158–159voidfunction,160–161staticvariables,172–174temporary,155–156variablescope,152–153working,153–155Functionpointers,433–435GGetCommand(),351GetNewDinoName(),363,364GetNumberOfDinos(),364–365getpwuid(),341,345getuid(),341gMyVarfunction,172gTailPtrvariable,352HHashtables,450–452Headerfile.
See#includefilehexdumpcommand,368I,Jifstatement,94–95,103–104avoidingmistakescompilerwarnings,109–110constantonleft,108ifstatementwithassignmentwarning,108ifstatementwithemptybody,109curlybraces,104–106lonelieststatement,107semicolon,106unintentionalassignment,107–108Implicitconversion,412#includefile,27Infiniteloops,113Infiniterecursionbug,430Initializervalues,173IntegertypesC99standard,187intandunsignedint,186INDEX484Integertypes(cont.
)longmodifier,186shortmodifier,186signedmodifier,186unsignedmodifier,186verboseintdeclarations,187InterCapconvention,46iOSApp,460–463iPhonesimulator,462isDarkvariable,107IsOdd.
xcodeprojIsOddprogram,126,127IsOddsourcecode,127–129isPrime,130–132itsARerun,101KkDinoRecordSize,365Kornshell(ksh),231Llesscommand,233Logicalmemoryaddress,167–168LogicaloperatorsAndandOroperators,100–102Notoperator,99–100TRUEandFALSEconstants,98truthtables,98loopCounter,112LoopTester.
xcodeproj,116–119lscommand,231,256ls-lcommand,232MMacuserinterfaceCocoaandCocoaTouch,457learningObjective-C,456–457malloc()blocksize,313DVDInfostruct,314myDVDPtr,314structDVDInfo*myDVDPtr,314voidpointer,313mancommand,233–234Minimum()function,159–160mkdir(makedirectory)command,250Murphy'slaw,382–383mv(move)command,250NNamer.
xcodeprojinputandoutput,257,258inputbuffer,259–260programcrash,262–263programming,261–262safenamer,263sourcecode,258NewDVDInfo(),352newEpisode,101NextPrime.
xcodeprojNextPrimeprogram,129–130NextPrimesourcecode,130–134NumberToRomanNumeral(),282–287OObjective-C,456–457,463–465OSXCodeCocoaapplicationproject,459,460foundationtoolproject,458OSSwapHostToBigInt32(),371Overflow.
xcodeprojboundschecking,224PrintFullName()function,225SIGABRTmessage,223strcat()functioncall,223stringcopyroutines,225strlcpy()andstrlcat()functions,224INDEX485PPagemap,168PassAlong()function,170Pathseparator,244PEMDASmnemonic,56Persistence,331Physicalmemoryaddress,167–168Pipes,252–253Pointers&operator,144*operatoraddress,149assignmentstatement,146debugger,150dereferences,149gamechanger,146memoryallocation,147,148valueassignment,149,150addressofvariable,142–144asparameters,161–162computerarchitectureandpointersizes,147–148disadvantages,167Factor.
xcodeproj,163–165levelofindirection,141librarycatalogs,138checking,141searchbycatalognumber,139–140searchbytitle,140searchwindow,139memoryaddresses,142NULLvalue,166pass-by-valuevs.
pass-by-reference,165–166RAM,141references,138typemodifier,151variabledeclaration,144–145Pre-processordirectives,68PrintFile.
xcodeprojfclose(),341fgetc(),340fopen(),340fpopen(),340HideExtensionoption,338main.
csourcecode,339MyDataFile.
txtfilecreation,337printf(),340putchar(),340savingMyDataFile.
txtfile,337–338SetHomeDirectory(),339,341TextEditapplication,337PrintMyVar()function,170PrintUsageAndExit(),374Programcounter(PC),79Programflowcontrolexpressionsassignmentstatement,95comparativeoperators,97–98compound,102–103logicaloperators(seeLogicaloperators)true,96–97TruthTester.
xcodeproj,102variables,95void,96IsOdd.
xcodeproj(seeIsOdd.
xcodeproj)NextPrime.
xcodeproj(seeNextPrime.
xcodeproj)statementsbreakstatement,125continuestatement,125–126dostatement,119–120forstatement(seeforstatement)ifstatement(seeifstatement)switchstatement(seeswitchstatement)whilestatement,110–113ProgrammingbasicsCprogramming,12INDEX486Programmingbasics(cont.
)forMacoriOSdevices,13,14Objective-C,C#,C++,andJava,12sourcecodebuildingapplication,18compilation,16,18summingnumbers1through10,15workspacewindow,16Pseudo-files,255Qqsort()function,438Quicksortalgorithm,438RReadDinoName(),365–366ReadFile(),355–356ReadLine(),272–275ReadStructFromFile(),356–357Recursioniterativeapproach,429recursiveapproach,430–433Relativepaths,245–246Remoteshell(rsh),231ReplaceNumbersInStream(),374–376rewind(),365Rightbit-shiftoperators,437RomanNumeraltoolcommand-linetool,371RomanNumeral.
xcodeproj(seeRomanNumeral.
xcodeproj)Terminalwindow,376–378RomanNumeral.
xcodeprojheaders,281main(),281,372–374NumberToRomanNumeral(),282–287PrintUsageAndExit(),374ReplaceNumbersInStream(),374–376SSecureshell(ssh),231SeeArgs.
xcodeproj,238–240SetHomeDirectory(),339,341Shellprogram,230,231,235–236Signedshift,437Simplestatements,106sortcommand,256Stableandunstablesorting,444StandardLibrary,33StandardLibraryfunction,332StandardLibrarysortingquicksortalgorithm,438SortDVDs.
xcodeprojCompareDVDCountries(),443CompareDVDRatings(),443,444CompareDVDTitles(),442main(),440–442PrintTestArray(),442Statetransition,277StructSize.
xcodeprojDVDInfostructsize,302sourcecodeanglebrackets(),303dataalignment,306DVDInfostructtype,305#includefile,303main.
c,302myInfo,305padding,306structSize.
hfile,303,304Xcode'sRelatedFilesmenu,304structtypedefs,422switchstatement,120breakstatement,121caselabel,120casewithnostatements,122–123defaultlabel,121,122fall-through,123–124INDEX487selectionstatements,121switchwrap-up,124–125TTENEXCshell(tcsh),231Translationunit,173tree/branch/leafanalogy,247Trickledowneffect,413Trinaryoperator,270TRUEconstant,98Truthtables,98,99TruthTester.
xcodeproj,102TurnOnLights(),107Two'scomplementnotation,49Typecastingcastoperator,417example,416explicitconversion,416pointers,417–419Typeconversionconversionrules,413–415conversionwarnings,415definition,411example,411implicitconversion,412trickledowneffect,413UUnaryindirectionoperator,151Unions,425–428uptimecommand,234VVirtualmemory,168voidfunction,160–161Wwccommand,256Whitespace,67–69WordCount.
xcodeprojresultsof,269sourcecodeconditionaloperator,270–271CountWords(),275–277functionprototypes,269,270headerfiles,269invertingcompoundconditionals,273–274ReadLine(),272–275testingWordCount,278–280WriteDinoName(),366–367WriteFile(),343,354–355X,YXcode.
SeeApple'sXcodeXcode'sbuilt-inmanuals,39–41ZZshell(zsh),231
优惠码50SSDOFF 首月5折50WHTSSD 年付5折15OFF 85折优惠,可循环使用荷兰VPSCPU内存SSD带宽IPv4价格购买1核1G50G1Gbps/3TB1个$ 9.10/月链接2核2G80G1Gbps/5TB1个$ 12.70/月链接2核3G100G1Gbps/7TB1个$ 16.30/月链接3核4G150G1Gbps/10TB1个$ 18.10/月链接阿联酋VPSCPU内存SS...
昨天有分享到"2021年Vultr新用户福利注册账户赠送50美元"文章,居然还有网友曾经没有注册过他家的账户,薅过他们家的羊毛。通过一阵折腾居然能注册到账户,但是对于如何开通云服务器稍微有点不对劲,对于新人来说确实有点疑惑。因为Vultr采用的是预付费充值方式,会在每月的一号扣费,当然我们账户需要存留余额或者我们采用自动扣费支付模式。把笔记中以前的文章推送给网友查看,他居然告诉我界面不同,看的不对...
关于TTCLOUD服务商在今年初的时候有介绍过一次,而且对于他们家的美国圣何塞服务器有过简单的测评,这个服务商主要是提供独立服务器业务的。目前托管硬件已经达到5000台服务器或节点,主要经营圣何塞,洛杉矶以及日本东京三个地区的数据中心业务。这次看到商家有推出了新上架的日本独立服务器促销活动,价格 $70/月起,季付送10Mbps带宽。也可以跟进客户的需求进行各种DIY定制。内存CPU硬盘流量带宽价...
parameters add为你推荐
行业关键词为什么有些行业关键词竟价出价很低有些行业很高google竞价排名谷歌竞价排名现在是显示在什么位置?无线路由器限速设置wifi怎么设置限速eset最新用户名密码ESET4.0最新用户名和密码正则表达式javajava正则表达式分词技术怎样做好百度分词技术和长尾词优化分词技术百度的中文分词原理是什么?与IK分词有区别吗?Qzongqzong皮肤上怎样写字微信电话本怎么用怎么用微信打电话网站推广外链我是新手SEO,请问网站怎样做外链推广
淘宝虚拟主机 域名是什么 日本vps 联通c套餐 主机 BWH 天猫双十一抢红包 河南服务器 jsp空间 php空间推荐 爱奇艺vip免费领取 如何建立邮箱 云营销系统 独立主机 服务器防火墙 广东主机托管 服务器托管价格 阿里云邮箱怎么注册 海外加速 美国vpn代理 更多