加入VIP
  • 专属下载特权
  • 现金文档折扣购买
  • VIP免费专区
  • 千万文档免费下载

上传资料

关闭

关闭

关闭

封号提示

内容

首页 一站式学习C编程

一站式学习C编程.pdf

一站式学习C编程

macintosh_xz
2011-04-28 0人阅读 举报 0 0 暂无简介

简介:本文档为《一站式学习C编程pdf》,可适用于IT/计算机领域

LinuxC编程一站式学习下一页LinuxC编程一站式学习宋劲杉北京亚嵌教育研究中心<songjinshanATakaeduDOTorg>版权©,宋劲杉,北京亚嵌教育研究中心Permissionisgrantedtocopy,distributeandormodifythisdocumentunderthetermsoftheGNUFreeDocumentationLicense,VersionoranylaterversionpublishedbytheFreeSoftwareFoundationwiththeInvariantSectionsbeing前言,withnoFrontCoverTexts,andnoBackCoverTextsAcopyofthelicenseisincludedin附录C,GNUFreeDocumentationLicenseVersion,November修订历史修订添加了GFDL许可证正式网络发布。第三部分还很粗糙错误也有不少有待改进。第一部分和第二部分已经比较成熟第二部分还差三章没写。目录历史前言IC语言入门程序的基本概念程序和编程语言自然语言和形式语言程序的调试第一个程序常量、变量和表达式继续HelloWorld常量变量赋值表达式字符类型与字符编码简单函数数学函数自定义函数形参和实参局部变量与全局变量分支语句if语句ifelse语句布尔代数switch语句深入理解函数return语句增量式开发递归循环语句while语句dowhile语句for语句break和continue语句嵌套循环goto语句结构体复合数据类型--结构体数据抽象数据类型标志嵌套结构体数组数组的基本操作数组应用实例:统计随机数数组应用实例:直方图字符串多维数组编码风格缩进和空白注释标识符命名函数indent工具gdb单步执行和跟踪函数调用断点观察点段错误排序与查找算法的概念插入排序算法的时间复杂度分析归并排序线性查找折半查找栈与队列数据结构的概念堆栈深度优先搜索队列与广度优先搜索环形队列本阶段总结C语言基本语法思维方法与编程思想调试方法IIC语言本质计算机中数的表示为什么计算机用二进制计数不同进制之间的换算整数的加减运算浮点数数据类型详解整型浮点型类型转换IntegerPromotionUsualArithmeticConversion由赋值产生的类型转换强制类型转换编译器如何处理类型转换运算符详解位运算按位与、或、异或、取反运算移位运算掩码异或运算的一些特性其它运算符复合赋值运算符条件运算符逗号运算符sizeof运算符与typedef类型声明SideEffect与SequencePoint运算符总结计算机体系结构基础内存与地址CPU设备MMUMemoryHierarchyx汇编程序基础最简单的汇编程序x的寄存器第二个汇编程序寻址方式ELF文件目标文件可执行文件汇编与C之间的关系函数调用main函数和启动例程变量的存储布局结构体和联合体C内联汇编volatile限定符链接详解多目标文件的链接定义和声明extern和static关键字头文件定义和声明的详细规则静态库共享库编译、链接、运行动态链接的过程共享库的命名惯例虚拟内存管理预处理预处理的步骤宏定义函数式宏定义内联函数#、##运算符和可变参数宏展开的步骤条件预处理指示其它预处理特性Makefile基础基本规则隐含规则和模式规则变量自动处理头文件的依赖关系常用的make命令行选项指针指针的基本操作指针类型的参数和返回值指针与数组指针与const限定符指针与结构体指向指针的指针与指针数组指向数组的指针与多维数组函数类型和函数指针类型不完全类型和复杂声明函数接口本章的预备知识strcpy与strncpymalloc与free传入参数与传出参数两层指针的参数返回值是指针的情况回调函数可变参数C标准库字符串操作函数初始化字符串取字符串的长度拷贝字符串连接字符串比较字符串搜索字符串分割字符串标准IO库函数文件的基本概念fopenfclosestdinstdoutstderrerrno与perror函数以字节为单位的IO函数操作读写位置的函数以字符串为单位的IO函数以记录为单位的IO函数格式化IO函数C标准库的IO缓冲区数值字符串转换函数分配内存的函数本章综合练习链表编写中二叉树和哈希表编写中IIILinux系统编程文件与IO汇编程序的HelloworldC标准IO库函数与UnbufferedIO函数openclosereadwritelseekfcntlioctlmmap文件系统引言ext文件系统总体存储布局实例剖析数据块寻址文件和目录操作的系统函数VFS内核数据结构dup和dup函数进程引言环境变量进程控制fork函数exec函数wait和waitpid函数进程间通信管道其它IPC机制练习:实现简单的ShellShell脚本Shell的历史Shell如何执行命令执行交互式命令执行脚本Shell的基本语法变量文件名代换(Globbing):*命令代换:`或$()算术代换:$(())转义字符单引号双引号bash启动脚本作为交互登录Shell启动或者使用login参数启动以交互非登录Shell启动非交互启动以sh命令启动Shell脚本语法条件测试:testifthenelifelseficaseesacfordodonewhiledodone位置参数和特殊变量函数Shell脚本的调试方法正则表达式引言基本语法sedawk练习:在C语言中使用正则表达式信号信号的基本概念产生信号通过终端按键产生信号调用系统函数向进程发信号由软件条件产生信号阻塞信号信号在内核中的表示信号集操作函数sigprocmasksigpending捕捉信号内核如何实现信号的捕捉sigactionpause可重入函数sigatomict类型与volatile限定符竞态条件与sigsuspend函数关于SIGCHLD信号终端、作业控制与守护进程终端终端的基本概念终端登录过程网络登录过程作业控制Session与进程组与作业控制有关的信号守护进程线程线程的概念线程控制创建线程终止线程线程间同步mutexConditionVariableSemaphore其它线程间同步机制编程练习TCPIP协议基础TCPIP协议栈与数据包封装以太网(RFC)帧格式ARP数据报格式IP数据报格式IP地址与路由UDP段格式TCP协议段格式通讯时序流量控制socket编程预备知识网络字节序socket地址的数据类型及相关函数基于TCP协议的网络程序最简单的TCP网络程序错误处理与读写控制把client改为交互式输入使用fork并发处理多个client的请求setsockopt使用select基于UDP协议的网络程序UNIXDomainSocketIPC练习:实现简单的Web服务器基本HTTP协议执行CGI程序A字符编码ASCII码Unicode和在LinuxC编程中使用Unicode和B编译开发工具小结gcc常用选项gcc常见错误信息binutils常用命令CGNUFreeDocumentationLicenseVersion,November参考书目索引下一页历史历史上一页下一页历史本书改编和包含了以下两本书的部分章节这两本书均以GNUFreeDocumentationLicense发布。HowToThinkLikeAComputerScientist:LearningwithC作者AllenBDowney。原书由GreenTeaPress发行可以从http:wwwgreenteapresscom下载到。ProgrammingfromtheGroundUp:AnIntroductiontoProgrammingusingLinuxAssemblyLanguage作者JonathanBartlett。原书由BartlettPublishing发行可以从http:savannahnongnuorgprojectspgubook下载到。上一页下一页LinuxC编程一站式学习起始页前言附录CGNUFreeDocumentationLicenseVersion,November上一页下一页附录CGNUFreeDocumentationLicenseVersion,NovemberCopyright©,,,,FreeSoftwareFoundation,Inc<http:fsforg>Everyoneispermittedtocopyanddistributeverbatimcopiesofthislicensedocument,butchangingitisnotallowedPREAMBLEThepurposeofthisLicenseistomakeamanual,textbook,orotherfunctionalandusefuldocument"free"inthesenseoffreedom:toassureeveryonetheeffectivefreedomtocopyandredistributeit,withorwithoutmodifyingit,eithercommerciallyornoncommerciallySecondarily,thisLicensepreservesfortheauthorandpublisherawaytogetcreditfortheirwork,whilenotbeingconsideredresponsibleformodificationsmadebyothersThisLicenseisakindof"copyleft",whichmeansthatderivativeworksofthedocumentmustthemselvesbefreeinthesamesenseItcomplementstheGNUGeneralPublicLicense,whichisacopyleftlicensedesignedforfreesoftwareWehavedesignedthisLicenseinordertouseitformanualsforfreesoftware,becausefreesoftwareneedsfreedocumentation:afreeprogramshouldcomewithmanualsprovidingthesamefreedomsthatthesoftwaredoesButthisLicenseisnotlimitedtosoftwaremanualsitcanbeusedforanytextualwork,regardlessofsubjectmatterorwhetheritispublishedasaprintedbookWerecommendthisLicenseprincipallyforworkswhosepurposeisinstructionorreferenceAPPLICABILITYANDDEFINITIONSThisLicenseappliestoanymanualorotherwork,inanymedium,thatcontainsanoticeplacedbythecopyrightholdersayingitcanbedistributedunderthetermsofthisLicenseSuchanoticegrantsaworldwide,royaltyfreelicense,unlimitedinduration,tousethatworkundertheconditionsstatedhereinThe"Document",below,referstoanysuchmanualorworkAnymemberofthepublicisalicensee,andisaddressedas"you"Youacceptthelicenseifyoucopy,modifyordistributetheworkinawayrequiringpermissionundercopyrightlawA"ModifiedVersion"oftheDocumentmeansanyworkcontainingtheDocumentoraportionofit,eithercopiedverbatim,orwithmodificationsandortranslatedintoanotherlanguageA"SecondarySection"isanamedappendixorafrontmattersectionoftheDocumentthatdealsexclusivelywiththerelationshipofthepublishersorauthorsoftheDocumenttotheDocument'soverallsubject(ortorelatedmatters)andcontainsnothingthatcouldfalldirectlywithinthatoverallsubject(Thus,iftheDocumentisinpartatextbookofmathematics,aSecondarySectionmaynotexplainanymathematics)Therelationshipcouldbeamatterofhistoricalconnectionwiththesubjectorwithrelatedmatters,oroflegal,commercial,philosophical,ethicalorpoliticalpositionregardingthemThe"InvariantSections"arecertainSecondarySectionswhosetitlesaredesignated,asbeingthoseofInvariantSections,inthenoticethatsaysthattheDocumentisreleasedunderthisLicenseIfasectiondoesnotfittheabovedefinitionofSecondarythenitisnotallowedtobedesignatedasInvariantTheDocumentmaycontainzeroInvariantSectionsIftheDocumentdoesnotidentifyanyInvariantSectionsthentherearenoneThe"CoverTexts"arecertainshortpassagesoftextthatarelisted,asFrontCoverTextsorBackCoverTexts,inthenoticethatsaysthattheDocumentisreleasedunderthisLicenseAFrontCoverTextmaybeatmostwords,andaBackCoverTextmaybeatmostwordsA"Transparent"copyoftheDocumentmeansamachinereadablecopy,representedinaformatwhosespecificationisavailabletothegeneralpublic,thatissuitableforrevisingthedocumentstraightforwardlywithgenerictexteditorsor(forimagescomposedofpixels)genericpaintprogramsor(fordrawings)somewidelyavailabledrawingeditor,andthatissuitableforinputtotextformattersorforautomatictranslationtoavarietyofformatssuitableforinputtotextformattersAcopymadeinanotherwiseTransparentfileformatwhosemarkup,orabsenceofmarkup,hasbeenarrangedtothwartordiscouragesubsequentmodificationbyreadersisnotTransparentAnimageformatisnotTransparentifusedforanysubstantialamountoftextAcopythatisnot"Transparent"iscalled"Opaque"ExamplesofsuitableformatsforTransparentcopiesincludeplainASCIIwithoutmarkup,Texinfoinputformat,LaTeXinputformat,SGMLorXMLusingapubliclyavailableDTD,andstandardconformingsimpleHTML,PostScriptorPDFdesignedforhumanmodificationExamplesoftransparentimageformatsincludePNG,XCFandJPGOpaqueformatsincludeproprietaryformatsthatcanbereadandeditedonlybyproprietarywordprocessors,SGMLorXMLforwhichtheDTDandorprocessingtoolsarenotgenerallyavailable,andthemachinegeneratedHTML,PostScriptorPDFproducedbysomewordprocessorsforoutputpurposesonlyThe"TitlePage"means,foraprintedbook,thetitlepageitself,plussuchfollowingpagesasareneededtohold,legibly,thematerialthisLicenserequirestoappearinthetitlepageForworksinformatswhichdonothaveanytitlepageassuch,"TitlePage"meansthetextnearthemostprominentappearanceofthework'stitle,precedingthebeginningofthebodyofthetextThe"publisher"meansanypersonorentitythatdistributescopiesoftheDocumenttothepublicAsection"EntitledXYZ"meansanamedsubunitoftheDocumentwhosetitleeitherispreciselyXYZorcontainsXYZinparenthesesfollowingtextthattranslatesXYZinanotherlanguage(HereXYZstandsforaspecificsectionnamementionedbelow,suchas"Acknowledgements","Dedications","Endorsements",or"History")To"PreservetheTitle"ofsuchasectionwhenyoumodifytheDocumentmeansthatitremainsasection"EntitledXYZ"accordingtothisdefinitionTheDocumentmayincludeWarrantyDisclaimersnexttothenoticewhichstatesthatthisLicenseappliestotheDocumentTheseWarrantyDisclaimersareconsideredtobeincludedbyreferenceinthisLicense,butonlyasregardsdisclaimingwarranties:anyotherimplicationthattheseWarrantyDisclaimersmayhaveisvoidandhasnoeffectonthemeaningofthisLicenseVERBATIMCOPYINGYoumaycopyanddistributetheDocumentinanymedium,eithercommerciallyornoncommercially,providedthatthisLicense,thecopyrightnotices,andthelicensenoticesayingthisLicenseappliestotheDocumentarereproducedinallcopies,andthatyouaddnootherconditionswhatsoevertothoseofthisLicenseYoumaynotusetechnicalmeasurestoobstructorcontrolthereadingorfurthercopyingofthecopiesyoumakeordistributeHowever,youmayacceptcompensationinexchangeforcopiesIfyoudistributealargeenoughnumberofcopiesyoumustalsofollowtheconditionsinsectionYoumayalsolendcopies,underthesameconditionsstatedabove,andyoumaypubliclydisplaycopiesCOPYINGINQUANTITYIfyoupublishprintedcopies(orcopiesinmediathatcommonlyhaveprintedcovers)oftheDocument,numberingmorethan,andtheDocument'slicensenoticerequiresCoverTexts,youmustenclosethecopiesincoversthatcarry,clearlyandlegibly,alltheseCoverTexts:FrontCoverTextsonthefrontcover,andBackCoverTextsonthebackcoverBothcoversmustalsoclearlyandlegiblyidentifyyouasthepublisherofthesecopiesThefrontcovermustpresentthefulltitlewithallwordsofthetitleequallyprominentandvisibleYoumayaddothermaterialonthecoversinadditionCopyingwithchangeslimitedtothecovers,aslongastheypreservethetitleoftheDocumentandsatisfytheseconditions,canbetreatedasverbatimcopyinginotherrespectsIftherequiredtextsforeithercoveraretoovoluminoustofitlegibly,youshouldputthefirstoneslisted(asmanyasfitreasonably)ontheactualcover,andcontinuetherestontoadjacentpagesIfyoupublishordistributeOpaquecopiesoftheDocumentnumberingmorethan,youmusteitherincludeamachinereadableTransparentcopyalongwitheachOpaquecopy,orstateinorwitheachOpaquecopyacomputernetworklocationfromwhichthegeneralnetworkusingpublichasaccesstodownloadusingpublicstandardnetworkprotocolsacompleteTransparentcopyoftheDocument,freeofaddedmaterialIfyouusethelatteroption,youmusttakereasonablyprudentsteps,whenyoubegindistributionofOpaquecopiesinquantity,toensurethatthisTransparentcopywillremainthusaccessibleatthestatedlocationuntilatleastoneyearafterthelasttimeyoudistributeanOpaquecopy(directlyorthroughyouragentsorretailers)ofthateditiontothepublicItisrequested,butnotrequired,thatyoucontacttheauthorsoftheDocumentwellbeforeredistributinganylargenumberofcopies,togivethemachancetoprovideyouwithanupdatedversionoftheDocumentMODIFICATIONSYoumaycopyanddistributeaModifiedVersionoftheDocumentundertheconditionsofsectionsandabove,providedthatyoureleasetheModifiedVersionunderpreciselythisLicense,withtheModifiedVersionfillingtheroleoftheDocument,thuslicensingdistributionandmodificationoftheModifiedVersiontowhoeverpossessesacopyofitInaddition,youmustdothesethingsintheModifiedVersion:*AUseintheTitlePage(andonthecovers,ifany)atitledistinctfromthatoftheDocument,andfromthoseofpreviousversions(whichshould,iftherewereany,belistedintheHistorysectionoftheDocument)Youmayusethesametitleasapreviousversioniftheoriginalpublisherofthatversiongivespermission*BListontheTitlePage,asauthors,oneormorepersonsorentitiesresponsibleforauthorshipofthemodificationsintheModifiedVersion,togetherwithatleastfiveoftheprincipalauthorsoftheDocument(allofitsprincipalauthors,ifithasfewerthanfive),unlesstheyreleaseyoufromthisrequirement*CStateontheTitlepagethenameofthepublisheroftheModifiedVersion,asthepublisher*DPreserveallthecopyrightnoticesoftheDocument*EAddanappropriatecopyrightnoticeforyourmodificationsadjacenttotheothercopyrightnotices*FInclude,immediatelyafterthecopyrightnotices,alicensenoticegivingthepublicpermissiontousetheModifiedVersionunderthetermsofthisLicense,intheformshownintheAddendumbelow*GPreserveinthatlicensenoticethefulllistsofInvariantSectionsandrequiredCoverTextsgivenintheDocument'slicensenotice*HIncludeanunalteredcopyofthisLicense*IPreservethesectionEntitled"History",PreserveitsTitle,andaddtoitanitemstatingatleastthetitle,year,newauthors,andpublisheroftheModifiedVersionasgivenontheTitlePageIfthereisnosectionEntitled"History"intheDocument,createonestatingthetitle,year,authors,andpublisheroftheDocumentasgivenonitsTitlePage,thenaddanitemdescribingtheModifiedVersionasstatedintheprevioussentence*JPreservethenetworklocation,ifany,givenintheDocumentforpublicaccesstoaTransparentcopyoftheDocument,andlikewisethenetworklocationsgivenintheDocumentforpreviousversionsitwasbasedonThesemaybeplacedinthe"History"sectionYoumayomitanetworklocationforaworkthatwaspublishedatleastfouryearsbeforetheDocumentitself,oriftheoriginalpublisheroftheversionitreferstogivespermission*KForanysectionEntitled"Acknowledgements"or"Dedications",PreservetheTitleofthesection,andpreserveinthesectionallthesubstanceandtoneofeachofthecontributoracknowledgementsandordedicationsgiventherein*LPreservealltheInvariantSectionsoftheDocument,unalteredintheirtextandintheirtitlesSectionnumbersortheequivalentarenotconsideredpartofthesectiontitles*MDeleteanysectionEntitled"Endorsements"SuchasectionmaynotbeincludedintheModifiedVersion*NDonotretitleanyexistingsectiontobeEntitled"Endorsements"ortoconflictintitlewithanyInvariantSection*OPreserveanyWarrantyDisclaimersIftheModifiedVersionincludesnewfrontmattersectionsorappendicesthatqualifyasSecondarySectionsandcontainnomaterialcopiedfromtheDocument,youmayatyouroptiondesignatesomeorallofthesesectionsasinvariantTodothis,addtheirtitlestothelistofInvariantSectionsintheModifiedVersion'slicensenoticeThesetitlesmustbedistinctfromanyothersectiontitlesYoumayaddasectionEntitled"Endorsements",provideditcontainsnothingbutendorsementsofyourModifiedVersionbyvariouspartiesforexample,statementsofpeerrevieworthatthetexthasbeenapprovedbyanorganizationastheauthoritativedefinitionofastandardYoumayaddapassageofuptofivewordsasaFrontCoverText,andapassageofuptowordsasaBackCoverText,totheendofthelistofCoverTextsintheModifiedVersionOnlyonepassageofFrontCoverTextandoneofBackCoverTextmaybeaddedby(orthrougharrangementsmadeby)anyoneentityIftheDocumentalreadyincludesacovertextforthesamecover,previouslyaddedbyyouorbyarrangementmadebythesameentityyouareactingonbehalfof,youmaynotaddanotherbutyoumayreplacetheoldone,onexplicitpermissionfromthepreviouspublisherthataddedtheoldoneTheauthor(s)andpublisher(s)oftheDocumentdonotbythisLicensegivepermissiontousetheirnamesforpublicityforortoassertorimplyendorsementofanyModifiedVersionCOMBININGDOCUMENTSYoumaycombinetheDocumentwithotherdocumentsreleasedunderthisLicense,underthetermsdefinedinsectionaboveformodifiedversions,providedthatyouincludeinthecombinationalloftheInvariantSectionsofalloftheoriginaldocuments,unmodified,andlistthemallasInvariantSectionsofyourcombinedworkinitslicensenotice,andthatyoupreservealltheirWarrantyDisclaimersThecombinedworkneedonlycontainonecopyofthisLicense,andmultipleidenticalInvariantSectionsmaybereplacedwithasinglecopyIftherea

用户评价(2)

关闭

新课改视野下建构高中语文教学实验成果报告(32KB)

抱歉,积分不足下载失败,请稍后再试!

提示

试读已结束,如需要继续阅读或者下载,敬请购买!

文档小程序码

使用微信“扫一扫”扫码寻找文档

1

打开微信

2

扫描小程序码

3

发布寻找信息

4

等待寻找结果

我知道了
评分:

/49

一站式学习C编程

仅供在线阅读

VIP

在线
客服

免费
邮箱

爱问共享资料服务号

扫描关注领取更多福利