freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

cprogrammingtutorial–parti(編輯修改稿)

2024-11-29 17:52 本頁(yè)面
 

【文章內(nèi)容簡(jiǎn)介】 ions ? Any nontrivial program will have multiple functions ? C functions look like methods in Java ? Functions have return types – int, float, void, etc. ? Functions have unique names ? Functions have parameters passed into them ? Before a function can be used, it must be declared and/or defined – a function declaration alone is called a prototype – prototypes can be in a separate header file or included in the file their definition appears in Function Example include define PI float calcArea(float)。 // prototype for function to be defined later int main() { float radius, area。 printf(“Enter radius of a circle: “)。 scanf(“%f”, amp。radius)。 area = calcArea(radius)。 // call function printf(“Area of circle with radius %f is: %f\n”, radius, area)。 return 0。 } float calcArea(float radius) { return PI * radius * radius。 } Arrays ? Like Java, C has arrays – they are declared slightly different – indexes still go from 0 to size1 ? C arrays have some major differences from Java – if you try to access an index outside of the array, C will probably let you – C arrays are kept on the stack ? this limits the maximum size of an array – size of a C array must be statically declared ? no using variables for the size Declaring Arrays ? Legal array declarations int scores[20]。 define MAX_LINE 80 char line[MAX_LINE]。 // place 80 inside [ ] at pile time ? Illegal array declaration int x = 10。 float nums[x]。 // using variable for array size Initializing Arrays ? Legal initializations int scores[5] = { 2, 3, 10, 0, 4 }。 char name[20] = { “Jane Doe” }。 int totals[5]。 int i。 for(i=0。 i5。 i++) totals[i] = 0。 char line[MAX_LINE]。 scanf(“%s”, line)。 ? Illegal initialization int scores[5]。 scores = { 2, 3, 10, 0, 4 }。 More on Arrays ? Accessing arrays – exactly like Java except: ? no .length parameter in array
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1