c语言程序设计课件ppt(英文)c program language 之6 points and array

c语言程序设计课件ppt(英文)c program language 之6 points and array

ID:17418907

大小:1.72 MB

页数:89页

时间:2018-08-31

c语言程序设计课件ppt(英文)c program language 之6 points and array_第1页
c语言程序设计课件ppt(英文)c program language 之6 points and array_第2页
c语言程序设计课件ppt(英文)c program language 之6 points and array_第3页
c语言程序设计课件ppt(英文)c program language 之6 points and array_第4页
c语言程序设计课件ppt(英文)c program language 之6 points and array_第5页
资源描述:

《c语言程序设计课件ppt(英文)c program language 之6 points and array》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、PointsandArrayXueQing2009.4Terms&arithmeticArray 2-Darray Address Pointer Callbyreference PointerarrayGetmax(min)value Sort Insert Delete Stringcopy StringconectStringcomparisionPointsandArrayOnedimensionalArraysMultidimentsionalArraysPointersandAddressesPointersandFunctionArgu

2、mentsPointersandarrayCharacterPointersandFunctions&*array132Anarrayisadatatypethatusessubscripted(下标)variablesandmakespossibletherepresentationofalargenumberofhomogeneousvalues.InC,arraysandpointersarecloserelatedconcepts.Anarraynamebyitselfistreatedasaconstantpointer,andpointe

3、rs,likearrays,canbesubscripted.Stringsareone-dimensionalarraysofcharacters.1WhatisArrayinta[10]floata[30][5]OnedimensionalArraysIfyoudeclareinta,bc;therelationshipbetweena,b,c?Ifyoudeclareinta1,a2,a3……asthestudentsscore,thenumberofthegradesislarge,representingandmanipulatingthe

4、databymeansofuniqueidentifierswillbecumbersome.Howtogroupseveraldatawiththesametypetogether?ArrayThesametypeLimitednumbersStoreinsequenceOnedimensionalArrays2Howtodeclareaarray?Typearray-name[length]AllarraymembersarethesametypeAlso:size--Howmanyarraymembersinta[10]3Howtoaccess

5、arraymembers?NameandsubscriptFrom0tolenth-14Howtostorearraymembersinmemory?a[0]a[2]a[4]a[3]a[6]a[7]a[1]a[5]a[8]a[9]memoryStoreinsequencefromthefirstelementtothelastone.a[0]a[2]a[4]a[3]a[6]a[7]a[1]a[5]a[8]a[9]memory5Howtoinitializeanarray?inta[10]={1,2,3,4,5,6,7,8,9,0};floatx[5]

6、={1.9,2.0};inta[]={1,2,3,4};main(){inti,inta[10]={1,2,3,4,5,6,7,8,9,10};for(i=0;i<10;i++)printf(“%d,”,a[i]);}the1stsubscriptis0.OnedimensionalArraysmain(){inti,inta[10];for(i=0;i<10;i++)scanf(“%d”,&a[i]);for(i=0;i<10;i++)printf(“%d,”,a[i]);}OnedimensionalArraysAarraywith10membe

7、rs,findtheminimumanditssubscript,andtheninterchangeitsvaluewiththefirstmember.71332668153206512inta[10]71331682653206512a[0]a[i]a[9]Temporaryvariables:min,kSupposethefirstistheminimum:min=a[0],k=0Comparemintoeachmembersa[i],ifa[i]

8、sgotothenextone.OnedimensionalArrays13<26min=a[1]k=126

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。