SlideShare una empresa de Scribd logo
1 de 40
Programming C#, 3rd Edition Introduction (part 1) 寶來 資工部 簡伯松 PoSung Chien (Poisson)
Agenda ,[object Object],[object Object],[object Object]
CHAPTER 6 ,[object Object]
運算子的分類 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Arithmetic operators ( 算數運算 ) Operator name Syntax Overloadable Basic assignment a  =  b No Addition a  +  b Yes Subtraction a  -  b Yes Unary plus (integer promotion) + a Yes Unary minus (additive inverse) - a Yes Multiplication a  *  b Yes Division a  /  b Yes Modulo (remainder) a  %  b Yes Increment ++ a, a ++ Yes Decrement -- a, a -- Yes
Comparison operators /  Relational operators ( 比較運算 ) Operator name Syntax Overloadable Equal to a  ==  b Yes Not equal to a  !=  b Yes Greater than a  >  b Yes Less than a  <  b Yes Greater than or equal to a  >=  b Yes Less than or equal to a  <=  b Yes
Logical operators ( 邏輯運算 ) Operator name Syntax Overloadable Logical negation (NOT) ! a Yes Logical AND a  &&  b Yes Logical OR a  ||  b Yes
Bitwise operators ( 位元運算 ) Operator name Syntax Overloadable Bitwise NOT ~ a Yes Bitwise AND a  &  b Yes Bitwise OR a  |  b Yes Bitwise XOR a  ^  b Yes Bitwise left shift a  <<  b Yes Bitwise right shift a  >>  b Yes
Compound-assignment operators  ( 複合賦值 ) Operator name Syntax Overloadable Addition assignment a  +=  b Yes Subtraction assignment a  -=  b Yes Multiplication assignment a  *=  b Yes Division assignment a  /=  b Yes Modulo assignment a  %=  b Yes Bitwise AND assignment a  &=  b Yes Bitwise OR assignment a  |=  b Yes Bitwise XOR assignment a  ^=  b Yes Bitwise left shift assignment a  <<=  b Yes Bitwise right shift assignment a  >>=  b Yes
Member and pointer operators  ( 成員及指標 ) Operator name Syntax Overloadable Array subscript a [ b ] Yes Indirection (&quot;variable pointed to by  a &quot;) * a No Reference (&quot;address of  a &quot;) & a No Member  b  of object pointed to by  a  (unsafe) a -> b No Member  b  of object  a a . b No Member pointed to by  b  of object pointed to by  a   (unsafe) a ->* b No Member pointed to by  b  of object  a  (unsafe) a .* b No
Other operators ( 其它 ) Operator name Syntax Overloadable Function call  See Function object . a ( a1, a2 ) Yes is operator object is string No True / False true, false Yes Ternary conditional a  ?  b  :  c No Size-of sizeof (a) sizeof ( type ) No Type identification typeof (a) typeof ( type ) No Cast (implicit, explicit) ( type ) a Yes Allocate storage new   type No
Unsafe  ,[object Object],[object Object]
運算子多載 ,[object Object],Stocks A = new Stocks(); Stocks B = new Stocks(); A + B = ? int add = 100 + 200;
DEMO ,[object Object],[object Object],[object Object],[object Object]
Operator pair define ,[object Object],[object Object]
運算子多載的缺點 ,[object Object],[object Object],[object Object],[object Object]
CHAPTER 7 ,[object Object]
Structs  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Structs  定義 ,[object Object]
DEMO ,[object Object],[object Object],[object Object],[object Object],[object Object]
Creating structs without new ,[object Object],[object Object]
CHAPTER 21 ,[object Object]
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Working with Directories ,[object Object],[object Object],[object Object],[object Object],[object Object]
Directory class methods ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
DirectoryInfo class methods ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Directory VS. DirectoryInfo ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
DEMO ,[object Object]
Working with Files ,[object Object],[object Object]
Experiment environment  ,[object Object],[object Object],[object Object],[object Object],[object Object]
Performance of reading File
Reading or Writing Class  Use  Stream   Abstract class that supports reading and writing bytes.  BinaryReader/ BinaryWriter   Read and write encoded strings and primitive datatypes to and from streams.  File ,  FileInfo ,  Directory ,  DirectoryInfo   Provide implementations for the abstract  FileSystemInfo  classes, including creating, moving, renaming, and deleting files and directories.  FileStream   For reading to and from  File  objects; supports random access to files. Opens files synchronously by default; supports asynchronous file access.  TextReader , T ex tWriter ,  StringReader , S t ringWriter   TextReader  and  TextWriter  are abstract classes designed for Unicode character I/O.  StringReader  and  StringWriter  write to and from strings, allowing your input and output to be either a stream or a string.
Reading or Writing (cont.) Class  Use  BufferedStream   A stream that adds buffering to another stream such as a  NetworkStream . Note that  FileStream  has buffering built in.  BufferedStreams  can improve performance of the stream to which they are attached.  MemoryStream   A nonbuffered stream whose encapsulated data is directly accessible in memory. A  MemoryStream  has no backing store, and is most useful as a temporary buffer.  NetworkStream   A stream over a network connection.
Binary Files ,[object Object]
Buffered Streams ,[object Object],[object Object],[object Object],[object Object]
實作 buffered I/O ,[object Object],[object Object],[object Object],[object Object]
實作 buffered I/O (cont.) ,[object Object],[object Object],[object Object],[object Object]
Working with Text Files ,[object Object]
DEMO ,[object Object]
Thanks for attention

Más contenido relacionado

La actualidad más candente

C LANGUAGE - BESTECH SOLUTIONS
C LANGUAGE - BESTECH SOLUTIONSC LANGUAGE - BESTECH SOLUTIONS
C LANGUAGE - BESTECH SOLUTIONSBESTECH SOLUTIONS
 
Glimpses of C++0x
Glimpses of C++0xGlimpses of C++0x
Glimpses of C++0xppd1961
 
Tutorial on c language programming
Tutorial on c language programmingTutorial on c language programming
Tutorial on c language programmingSudheer Kiran
 
User defined functions in C programmig
User defined functions in C programmigUser defined functions in C programmig
User defined functions in C programmigAppili Vamsi Krishna
 
Operator Overloading and Scope of Variable
Operator Overloading and Scope of VariableOperator Overloading and Scope of Variable
Operator Overloading and Scope of VariableMOHIT DADU
 
Lecture20 user definedfunctions.ppt
Lecture20 user definedfunctions.pptLecture20 user definedfunctions.ppt
Lecture20 user definedfunctions.ppteShikshak
 
Header files of c++ unit 3 -topic 3
Header files of c++ unit 3 -topic 3Header files of c++ unit 3 -topic 3
Header files of c++ unit 3 -topic 3MOHIT TOMAR
 
Basics of C programming
Basics of C programmingBasics of C programming
Basics of C programmingavikdhupar
 
358 33 powerpoint-slides_1-introduction-c_chapter-1
358 33 powerpoint-slides_1-introduction-c_chapter-1358 33 powerpoint-slides_1-introduction-c_chapter-1
358 33 powerpoint-slides_1-introduction-c_chapter-1sumitbardhan
 
C++ Programming Course
C++ Programming CourseC++ Programming Course
C++ Programming CourseDennis Chang
 
FUNCTION IN C PROGRAMMING UNIT -6 (BCA I SEM)
 FUNCTION IN C PROGRAMMING UNIT -6 (BCA I SEM) FUNCTION IN C PROGRAMMING UNIT -6 (BCA I SEM)
FUNCTION IN C PROGRAMMING UNIT -6 (BCA I SEM)Mansi Tyagi
 
Polymorphism and its types
Polymorphism and its typesPolymorphism and its types
Polymorphism and its typesSuraj Bora
 

La actualidad más candente (19)

3.5
3.53.5
3.5
 
Data types in c++
Data types in c++ Data types in c++
Data types in c++
 
C LANGUAGE - BESTECH SOLUTIONS
C LANGUAGE - BESTECH SOLUTIONSC LANGUAGE - BESTECH SOLUTIONS
C LANGUAGE - BESTECH SOLUTIONS
 
Glimpses of C++0x
Glimpses of C++0xGlimpses of C++0x
Glimpses of C++0x
 
Tutorial on c language programming
Tutorial on c language programmingTutorial on c language programming
Tutorial on c language programming
 
Python recursion
Python recursionPython recursion
Python recursion
 
User defined functions
User defined functionsUser defined functions
User defined functions
 
User defined functions in C programmig
User defined functions in C programmigUser defined functions in C programmig
User defined functions in C programmig
 
Function & Recursion
Function & RecursionFunction & Recursion
Function & Recursion
 
Operator Overloading and Scope of Variable
Operator Overloading and Scope of VariableOperator Overloading and Scope of Variable
Operator Overloading and Scope of Variable
 
Lecture20 user definedfunctions.ppt
Lecture20 user definedfunctions.pptLecture20 user definedfunctions.ppt
Lecture20 user definedfunctions.ppt
 
Header files of c++ unit 3 -topic 3
Header files of c++ unit 3 -topic 3Header files of c++ unit 3 -topic 3
Header files of c++ unit 3 -topic 3
 
Basics of C programming
Basics of C programmingBasics of C programming
Basics of C programming
 
Python libraries
Python librariesPython libraries
Python libraries
 
358 33 powerpoint-slides_1-introduction-c_chapter-1
358 33 powerpoint-slides_1-introduction-c_chapter-1358 33 powerpoint-slides_1-introduction-c_chapter-1
358 33 powerpoint-slides_1-introduction-c_chapter-1
 
C++ Programming Course
C++ Programming CourseC++ Programming Course
C++ Programming Course
 
FUNCTION IN C PROGRAMMING UNIT -6 (BCA I SEM)
 FUNCTION IN C PROGRAMMING UNIT -6 (BCA I SEM) FUNCTION IN C PROGRAMMING UNIT -6 (BCA I SEM)
FUNCTION IN C PROGRAMMING UNIT -6 (BCA I SEM)
 
Python algorithm
Python algorithmPython algorithm
Python algorithm
 
Polymorphism and its types
Polymorphism and its typesPolymorphism and its types
Polymorphism and its types
 

Destacado

Goede praktijken in overheidscommunicatie 2.0
Goede praktijken in overheidscommunicatie 2.0Goede praktijken in overheidscommunicatie 2.0
Goede praktijken in overheidscommunicatie 2.0Vanden Broele
 
Ambtenaren en sociale media: gevoelige zaak of opportuniteit
Ambtenaren en sociale media: gevoelige zaak of opportuniteitAmbtenaren en sociale media: gevoelige zaak of opportuniteit
Ambtenaren en sociale media: gevoelige zaak of opportuniteitVanden Broele
 
Доклад по системе подготовки кадров
Доклад по системе подготовки кадровДоклад по системе подготовки кадров
Доклад по системе подготовки кадровё-ИНЖИНИРИНГ
 
Testing Slideshare
Testing SlideshareTesting Slideshare
Testing Slidesharejenraider
 
FOSS_GNU/Linux
FOSS_GNU/LinuxFOSS_GNU/Linux
FOSS_GNU/LinuxYogesh Ks
 
TeQuiz - a Tech Quiz
TeQuiz - a Tech QuizTeQuiz - a Tech Quiz
TeQuiz - a Tech QuizYogesh Ks
 
Ficheiro de ortografia
Ficheiro de ortografiaFicheiro de ortografia
Ficheiro de ortografiajumagalhaes
 
FINAL SUBMITTED PAPER-TRENDS IN RENEWABLE ENERGY RESOURES AND THEIR APPLICATIONS
FINAL SUBMITTED PAPER-TRENDS IN RENEWABLE ENERGY RESOURES AND THEIR APPLICATIONSFINAL SUBMITTED PAPER-TRENDS IN RENEWABLE ENERGY RESOURES AND THEIR APPLICATIONS
FINAL SUBMITTED PAPER-TRENDS IN RENEWABLE ENERGY RESOURES AND THEIR APPLICATIONSNavneet Agarwal
 
Openstreetmap presentation of Mapping Party at FSMK camp
Openstreetmap presentation of Mapping Party at FSMK campOpenstreetmap presentation of Mapping Party at FSMK camp
Openstreetmap presentation of Mapping Party at FSMK campYogesh Ks
 
Cashflow secrets how we generate 6% per month with minimum risk!
Cashflow secrets  how we generate 6% per month with minimum risk! Cashflow secrets  how we generate 6% per month with minimum risk!
Cashflow secrets how we generate 6% per month with minimum risk! Duane Cunningham
 
Linux administration
Linux administrationLinux administration
Linux administrationYogesh Ks
 
Overheidscommunicatie 2.0
Overheidscommunicatie 2.0Overheidscommunicatie 2.0
Overheidscommunicatie 2.0Vanden Broele
 

Destacado (15)

Goede praktijken in overheidscommunicatie 2.0
Goede praktijken in overheidscommunicatie 2.0Goede praktijken in overheidscommunicatie 2.0
Goede praktijken in overheidscommunicatie 2.0
 
ё-ИНЖИНИРИНГ
ё-ИНЖИНИРИНГё-ИНЖИНИРИНГ
ё-ИНЖИНИРИНГ
 
Linux
LinuxLinux
Linux
 
Ambtenaren en sociale media: gevoelige zaak of opportuniteit
Ambtenaren en sociale media: gevoelige zaak of opportuniteitAmbtenaren en sociale media: gevoelige zaak of opportuniteit
Ambtenaren en sociale media: gevoelige zaak of opportuniteit
 
Доклад по системе подготовки кадров
Доклад по системе подготовки кадровДоклад по системе подготовки кадров
Доклад по системе подготовки кадров
 
Testing Slideshare
Testing SlideshareTesting Slideshare
Testing Slideshare
 
FOSS_GNU/Linux
FOSS_GNU/LinuxFOSS_GNU/Linux
FOSS_GNU/Linux
 
TeQuiz - a Tech Quiz
TeQuiz - a Tech QuizTeQuiz - a Tech Quiz
TeQuiz - a Tech Quiz
 
Ficheiro de ortografia
Ficheiro de ortografiaFicheiro de ortografia
Ficheiro de ortografia
 
FINAL SUBMITTED PAPER-TRENDS IN RENEWABLE ENERGY RESOURES AND THEIR APPLICATIONS
FINAL SUBMITTED PAPER-TRENDS IN RENEWABLE ENERGY RESOURES AND THEIR APPLICATIONSFINAL SUBMITTED PAPER-TRENDS IN RENEWABLE ENERGY RESOURES AND THEIR APPLICATIONS
FINAL SUBMITTED PAPER-TRENDS IN RENEWABLE ENERGY RESOURES AND THEIR APPLICATIONS
 
ё-ENGINEERING
ё-ENGINEERINGё-ENGINEERING
ё-ENGINEERING
 
Openstreetmap presentation of Mapping Party at FSMK camp
Openstreetmap presentation of Mapping Party at FSMK campOpenstreetmap presentation of Mapping Party at FSMK camp
Openstreetmap presentation of Mapping Party at FSMK camp
 
Cashflow secrets how we generate 6% per month with minimum risk!
Cashflow secrets  how we generate 6% per month with minimum risk! Cashflow secrets  how we generate 6% per month with minimum risk!
Cashflow secrets how we generate 6% per month with minimum risk!
 
Linux administration
Linux administrationLinux administration
Linux administration
 
Overheidscommunicatie 2.0
Overheidscommunicatie 2.0Overheidscommunicatie 2.0
Overheidscommunicatie 2.0
 

Similar a Programming c sharp 3rd ch6 7 21

CPP-overviews notes variable data types notes
CPP-overviews notes variable data types notesCPP-overviews notes variable data types notes
CPP-overviews notes variable data types notesSukhpreetSingh519414
 
An Overview Of Python With Functional Programming
An Overview Of Python With Functional ProgrammingAn Overview Of Python With Functional Programming
An Overview Of Python With Functional ProgrammingAdam Getchell
 
C, C++ Interview Questions Part - 1
C, C++ Interview Questions Part - 1C, C++ Interview Questions Part - 1
C, C++ Interview Questions Part - 1ReKruiTIn.com
 
Virtual Function and Polymorphism.ppt
Virtual Function and Polymorphism.pptVirtual Function and Polymorphism.ppt
Virtual Function and Polymorphism.pptishan743441
 
Introduction to Client-Side Javascript
Introduction to Client-Side JavascriptIntroduction to Client-Side Javascript
Introduction to Client-Side JavascriptJulie Iskander
 
cppt-170218053903 (1).pptx
cppt-170218053903 (1).pptxcppt-170218053903 (1).pptx
cppt-170218053903 (1).pptxWatchDog13
 
Introduction to c++
Introduction to c++Introduction to c++
Introduction to c++somu rajesh
 
Whats New In C# 4 0 - NetPonto
Whats New In C# 4 0 - NetPontoWhats New In C# 4 0 - NetPonto
Whats New In C# 4 0 - NetPontoPaulo Morgado
 
C++ Interview Question And Answer
C++ Interview Question And AnswerC++ Interview Question And Answer
C++ Interview Question And AnswerJagan Mohan Bishoyi
 
C++ questions And Answer
C++ questions And AnswerC++ questions And Answer
C++ questions And Answerlavparmar007
 
Visual Studio .NET2010
Visual Studio .NET2010Visual Studio .NET2010
Visual Studio .NET2010Satish Verma
 
Lambdas & Streams
Lambdas & StreamsLambdas & Streams
Lambdas & StreamsC4Media
 
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for DevelopersMSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for DevelopersDave Bost
 
Visual Studio 2010 and .NET 4.0 Overview
Visual Studio 2010 and .NET 4.0 OverviewVisual Studio 2010 and .NET 4.0 Overview
Visual Studio 2010 and .NET 4.0 Overviewbwullems
 

Similar a Programming c sharp 3rd ch6 7 21 (20)

CPP-overviews notes variable data types notes
CPP-overviews notes variable data types notesCPP-overviews notes variable data types notes
CPP-overviews notes variable data types notes
 
An Overview Of Python With Functional Programming
An Overview Of Python With Functional ProgrammingAn Overview Of Python With Functional Programming
An Overview Of Python With Functional Programming
 
C, C++ Interview Questions Part - 1
C, C++ Interview Questions Part - 1C, C++ Interview Questions Part - 1
C, C++ Interview Questions Part - 1
 
Basics of c++
Basics of c++Basics of c++
Basics of c++
 
Virtual Function and Polymorphism.ppt
Virtual Function and Polymorphism.pptVirtual Function and Polymorphism.ppt
Virtual Function and Polymorphism.ppt
 
Introduction to Client-Side Javascript
Introduction to Client-Side JavascriptIntroduction to Client-Side Javascript
Introduction to Client-Side Javascript
 
Python and You Series
Python and You SeriesPython and You Series
Python and You Series
 
cppt-170218053903 (1).pptx
cppt-170218053903 (1).pptxcppt-170218053903 (1).pptx
cppt-170218053903 (1).pptx
 
Introduction to c++
Introduction to c++Introduction to c++
Introduction to c++
 
Whats New In C# 4 0 - NetPonto
Whats New In C# 4 0 - NetPontoWhats New In C# 4 0 - NetPonto
Whats New In C# 4 0 - NetPonto
 
C++ Interview Question And Answer
C++ Interview Question And AnswerC++ Interview Question And Answer
C++ Interview Question And Answer
 
C++ questions And Answer
C++ questions And AnswerC++ questions And Answer
C++ questions And Answer
 
Unit v
Unit vUnit v
Unit v
 
Visual Studio .NET2010
Visual Studio .NET2010Visual Studio .NET2010
Visual Studio .NET2010
 
Lambdas & Streams
Lambdas & StreamsLambdas & Streams
Lambdas & Streams
 
C++ Overview PPT
C++ Overview PPTC++ Overview PPT
C++ Overview PPT
 
C++
C++C++
C++
 
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for DevelopersMSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
 
C++ language
C++ languageC++ language
C++ language
 
Visual Studio 2010 and .NET 4.0 Overview
Visual Studio 2010 and .NET 4.0 OverviewVisual Studio 2010 and .NET 4.0 Overview
Visual Studio 2010 and .NET 4.0 Overview
 

Último

Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 

Último (20)

Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 

Programming c sharp 3rd ch6 7 21

  • 1. Programming C#, 3rd Edition Introduction (part 1) 寶來 資工部 簡伯松 PoSung Chien (Poisson)
  • 2.
  • 3.
  • 4.
  • 5. Arithmetic operators ( 算數運算 ) Operator name Syntax Overloadable Basic assignment a = b No Addition a + b Yes Subtraction a - b Yes Unary plus (integer promotion) + a Yes Unary minus (additive inverse) - a Yes Multiplication a * b Yes Division a / b Yes Modulo (remainder) a % b Yes Increment ++ a, a ++ Yes Decrement -- a, a -- Yes
  • 6. Comparison operators / Relational operators ( 比較運算 ) Operator name Syntax Overloadable Equal to a == b Yes Not equal to a != b Yes Greater than a > b Yes Less than a < b Yes Greater than or equal to a >= b Yes Less than or equal to a <= b Yes
  • 7. Logical operators ( 邏輯運算 ) Operator name Syntax Overloadable Logical negation (NOT) ! a Yes Logical AND a && b Yes Logical OR a || b Yes
  • 8. Bitwise operators ( 位元運算 ) Operator name Syntax Overloadable Bitwise NOT ~ a Yes Bitwise AND a & b Yes Bitwise OR a | b Yes Bitwise XOR a ^ b Yes Bitwise left shift a << b Yes Bitwise right shift a >> b Yes
  • 9. Compound-assignment operators ( 複合賦值 ) Operator name Syntax Overloadable Addition assignment a += b Yes Subtraction assignment a -= b Yes Multiplication assignment a *= b Yes Division assignment a /= b Yes Modulo assignment a %= b Yes Bitwise AND assignment a &= b Yes Bitwise OR assignment a |= b Yes Bitwise XOR assignment a ^= b Yes Bitwise left shift assignment a <<= b Yes Bitwise right shift assignment a >>= b Yes
  • 10. Member and pointer operators ( 成員及指標 ) Operator name Syntax Overloadable Array subscript a [ b ] Yes Indirection (&quot;variable pointed to by a &quot;) * a No Reference (&quot;address of a &quot;) & a No Member b of object pointed to by a (unsafe) a -> b No Member b of object a a . b No Member pointed to by b of object pointed to by a (unsafe) a ->* b No Member pointed to by b of object a (unsafe) a .* b No
  • 11. Other operators ( 其它 ) Operator name Syntax Overloadable Function call See Function object . a ( a1, a2 ) Yes is operator object is string No True / False true, false Yes Ternary conditional a ? b : c No Size-of sizeof (a) sizeof ( type ) No Type identification typeof (a) typeof ( type ) No Cast (implicit, explicit) ( type ) a Yes Allocate storage new type No
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 32. Reading or Writing Class Use Stream Abstract class that supports reading and writing bytes. BinaryReader/ BinaryWriter Read and write encoded strings and primitive datatypes to and from streams. File , FileInfo , Directory , DirectoryInfo Provide implementations for the abstract FileSystemInfo classes, including creating, moving, renaming, and deleting files and directories. FileStream For reading to and from File objects; supports random access to files. Opens files synchronously by default; supports asynchronous file access. TextReader , T ex tWriter , StringReader , S t ringWriter TextReader and TextWriter are abstract classes designed for Unicode character I/O. StringReader and StringWriter write to and from strings, allowing your input and output to be either a stream or a string.
  • 33. Reading or Writing (cont.) Class Use BufferedStream A stream that adds buffering to another stream such as a NetworkStream . Note that FileStream has buffering built in. BufferedStreams can improve performance of the stream to which they are attached. MemoryStream A nonbuffered stream whose encapsulated data is directly accessible in memory. A MemoryStream has no backing store, and is most useful as a temporary buffer. NetworkStream A stream over a network connection.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.

Notas del editor

  1. Reference : http://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B Reference : http://msdn.microsoft.com/zh-tw/library/8edha89s(VS.80).aspx
  2. Reference : http://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B Reference : http://msdn.microsoft.com/zh-tw/library/8edha89s(VS.80).aspx
  3. Reference : http://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B Reference : http://msdn.microsoft.com/zh-tw/library/8edha89s(VS.80).aspx
  4. Reference : http://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B Reference : http://msdn.microsoft.com/zh-tw/library/8edha89s(VS.80).aspx
  5. Reference : http://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B Reference : http://msdn.microsoft.com/zh-tw/library/8edha89s(VS.80).aspx
  6. Reference : http://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B Reference : http://msdn.microsoft.com/zh-tw/library/8edha89s(VS.80).aspx
  7. Reference : http://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B Reference : http://msdn.microsoft.com/zh-tw/library/8edha89s(VS.80).aspx
  8. Reference : 不可多載的運算子 in c# http://msdn.microsoft.com/zh-tw/library/8edha89s(VS.80).aspx
  9. Reference : http://msdn.microsoft.com/zh-tw/library/7bxsh36e%28v=VS.90%29.aspx 編譯器錯誤 CS0216 Reference : http://msdn.microsoft.com/zh-tw/library/4wtxwb6k%28VS.80%29.aspx 編譯器警告 ( 層級 3) CS0660
  10. Reference : http://lagunawang.pixnet.net/blog/post/20160001
  11. Reference : http://msdn.microsoft.com/zh-tw/library/saxz13w4%28v=vs.80%29.aspx The stack is always used to store the following two things: The reference portion of reference-typed local variables and parameters (such as the myTextBox reference ) Value-typed local variables and method parameters (structs, as well as integer s, bool s, char s, DateTime s, etc.) The following data is stored on the heap: The content of reference-type objects. Anything structured inside a reference-type object. 只要 struct 是放在 class 裡 這個 struct 也是會被放在 Heap 而不是 Stack. struct 裡面有 class 的話, struct 會存在 Stack 裡,而其中有一個 指標指到 Heap 中 class 。 Class 裡面有 struct 的話, stack 裡只會在 class 的指標,而 struct 會存在 Heap 中的 Class 裡
  12. Reference : http://msdn.microsoft.com/zh-tw/library/ah19swz4%28v=vs.80%29.aspx Reference : http://msdn.microsoft.com/en-us/library/ah19swz4%28v=vs.71%29.aspx [attributes] : public, private
  13. Reference : http://stackoverflow.com/questions/3146586/directory-vs-directoryinfo
  14. Reference : http://msdn.microsoft.com/zh-tw/library/system.io.directoryinfo_methods%28v=VS.80%29.aspx public static IEnumerable&lt;string&gt; EnumerateDirectories( string path ) public IEnumerable&lt;FileInfo&gt; EnumerateFiles() public FileSystemInfo[] GetFileSystemInfos ( string searchPattern ) public static string[] GetDirectories ( string path )
  15. 先用 stream 打開檔案,再用 BufferedStream 來承接, 之後我們就對 BufferedStream 做操作既可。