Programming in c stephen g cochan

564 1.2K 0
Programming in c   stephen g cochan

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Đây là bộ sách tiếng anh cho dân công nghệ thông tin chuyên về bảo mật,lập trình.Thích hợp cho những ai đam mê về công nghệ thông tin,tìm hiểu về bảo mật và lập trình.

[...]... bestselling titles on the C language, including Programming in C, Programming in ANSI C, and Topics in C Programming, and several Unix titles, including Exploring the Unix System, Unix Shell Programming, and Unix System Security Mr Kochan’s most recent title, Programming in Objective -C, is a tutorial on an object-oriented programming language that is based on C Acknowledgements I wish to thank the following...x Contents Structures Containing Arrays 187 Structure Variants 190 Exercises 191 10 Character Strings 195 Arrays of Characters 196 Variable-Length Character Strings 198 Initializing and Displaying Character Strings 201 Testing Two Character Strings for Equality 204 Inputting Character Strings 206 Single-Character Input 208 The Null String 213 Escape Characters 216 More on Constant Strings 218 Character... is gcc.Typing the line gcc prog1 .c has the effect of initiating the compilation process with the source program contained in prog1 .c In the first step of the compilation process, the compiler examines each program statement contained in the source program and checks it to ensure that it conforms to the syntax and semantics of the language1 If any mistakes are discovered by the compiler 1.Technically... Debugging with the Preprocessor 389 Debugging Programs with gdb 395 Working with Variables 398 Source File Display 399 Controlling Program Execution 400 Getting a Stack Trace 405 Calling Functions and Setting Arrays and Structures 405 Getting Help with gdb Commands 406 Odds and Ends 408 19 Object-Oriented Programming 411 What Is an Object Anyway? 411 Instances and Methods 412 Writing a C Program to... in C? To begin with, you’ll choose a rather simple example—a program that displays the phrase Programming is fun.” in your window Program 3.1 shows a C program to accomplish this task Program 3.1 Writing Your First C Program #include int main (void) { printf ( "Programming is fun.\n"); return 0; } In the C programming language, lowercase and uppercase letters are distinct In addition, in C, ... such as vi or emacs 12 Chapter 3 Compiling and Running Your First Program Most C compilers recognize filenames that end in the two characters “.” and c as C programs So, assume you type Program 3.1 into a file called prog1 .c Next, you need to compile the program Using the GNU C compiler, this can be as simple as issuing the gcc command at the terminal followed by the filename, like this: $ gcc prog1 .c. .. Features,” includes those features of the language that are of a more advanced or esoteric nature Chapter 18, “Debugging Programs,” shows how you can use the C preprocessor to help debug your programs It also introduces you to interactive debugging.The popular debugger gdb was chosen to illustrate this debugging technique Over the last decade, the programming world has been abuzz with the notion of object-oriented... object-oriented programming, or OOP for short C is not an OOP language; however, several other programming languages that are based on C are OOP languages Chapter 19, “Object-Oriented Programming, ” gives a brief introduction to OOP and some of its Introduction terminology It also gives a brief overview of three OOP languages that are based on C, namely C+ +, C# , and Objective -C Appendix A, C Language Summary,”... Format Conversion Functions 478 String-to-Number Conversion 479 xv xvi Contents Dynamic Memory Allocation Functions 481 Math Functions 482 Complex Arithmetic 488 General Utility Functions 490 C Compiling Programs with gcc 493 General Command Format 493 Command-Line Options 494 D Common Programming Mistakes 497 E Resources 501 Answers to Exercises, Errata, etc 501 The C Programming Language 501 Books 501... not compiled Other examples include the Unix system’s shell and Python Some vendors also offer interpreters for the C programming language 3 Compiling and Running Your First Program I N THIS CHAPTER, YOU ARE INTRODUCED to the C language so that you can see what programming in C is all about.What better way to gain an appreciation for this language than by taking a look at an actual program written in . including Programming in C, Programming in ANSI C, and Topics in C Programming, and several Unix titles, including Exploring the Unix System, Unix Shell Programming, . Character Strings 195 Arrays of Characters 196 Va r iable-Length Character Strings 198 Initializing and Displaying Character Strings 201 Testing Two Character

Ngày đăng: 19/03/2014, 13:42

Từ khóa liên quan

Mục lục

  • cover.pdf

  • page_r1.pdf

  • page_r2.pdf

  • page_r3.pdf

  • page_r4.pdf

  • page_r5.pdf

  • page_r6.pdf

  • page_r7.pdf

  • page_r8.pdf

  • page_r9.pdf

  • page_r10.pdf

  • page_r11.pdf

  • page_r12.pdf

  • page_r13.pdf

  • page_r14.pdf

  • page_r15.pdf

  • page_r16.pdf

  • page_r17.pdf

  • page_r18.pdf

  • page_r19.pdf

Tài liệu cùng người dùng

Tài liệu liên quan