跳到主要內容

計算導論與 C 語言基礎:第七週(C語言中的數據成分 Part I)

C語言中的數據成分 Part I


在C程序語言中,變量必須先定義再使用
程式中可以改變的值==>變量
C/C++程序中的數據類型







判斷任何一種數據類型的字節長度



第二課:


複數補碼的求法


打印一個數的十六進制表示









反過來執行,從十六進制轉回其他進制




*最大與最小整數
unsigned integer(無符號整數的最大數值)






第三課
浮點型


若在一般情形下,浮點型數值默認輸出6位精度的數字。
利用設置精度方式來測試


浮點數的表示
浮點數的規範


使用須知


字符型


轉譯字符
參考範例:


布爾型


數值非0即1


常量:在程序運行過程中,其值保持不變的量


變量命名


保留字


命名方法有兩種常用的方式







留言

這個網誌中的熱門文章

【Android Development for Beginners】 Lesson 2A : Create a New Project , Plan How to Build the Layout, Build Layout

This Notes is according to the udacity free course : Android Development for Beginners Lesson 2A : Create a New Project Plan How to Build the Layout Build layout Follow the instruction below to build up a new app called "Just Java" use empty activity .

【 Android Development for Beginners】 Lesson 3A : Object Oriented Programming - 4

(I think Lesson 3A is the most important but also the most difficult part for beginner so far ) This Notes is according to the udacity free course : Android Development for Beginners Lesson 3A : Object Oriented Programming Call Method on an objects If We want to call a method on an object object variable name . method name ( input argument ); ex: titleTextView.setText("News"); You need to make sure you put a right object so you can call the method

【Android Development for Beginners】Lesson 2B : String Data Type, Combining Strings Together, and Integer Variables

This Notes is according to the udacity free course : Android Development for Beginners Lesson 2B :  String Data Type,  Combining Strings Together and Integer Variables Finally We cross the river and change the layouts successfully. But We can do it better by letting the price change automatically but not change after the we click the "order" button. So this is what we want to do in this class.