亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? unx17.htm

?? Unix Unleashed, Third Edition is written with the power user and system administrator in mind. This
?? HTM
?? 第 1 頁 / 共 3 頁
字號:
<HTML>

<HEAD>

<TITLE>UNIX Unleashed unx17.htm</TITLE>

<LINK REL="ToC" HREF="index.htm">

<LINK REL="Next" HREF="unxpt4au.htm">

<LINK REL="Previous" HREF="unx16.htm"></HEAD>

<BODY TEXT="#000000" LINK="#0000FF" VLINK="#800080" bgcolor=white>

<P><A HREF="unx16.htm"><IMG SRC="bluprev.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Previous Page"></A>

<A HREF="index.htm"><IMG SRC="blutoc.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="TOC"></A>

<A HREF="unxpt4au.htm"><IMG SRC="blunext.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Next Page"></A>

<A HREF="index.htm"><IMG SRC="bluprev.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Home"></A>

</P><UL>

<UL>

<LI>

<A HREF="#I1">17 &#151; The C Programming Language</A></LI>

<UL>

<UL>

<UL>

<LI>

<A HREF="#I3">By James Armstrong</A></LI></UL></UL>

<LI>

<A HREF="#I4">The History of C</A></LI>

<LI>

<A HREF="#I5">Creating, Compiling, and Executing Your First Program</A></LI>

<LI>

<A HREF="#I6">An Overview of the C Language</A></LI>

<UL>

<LI>

<A HREF="#I7">Elementary C Syntax</A></LI>

<LI>

<A HREF="#I8">Expressions</A></LI>

<UL>

<LI>

<A HREF="#I9">Comparison Expressions</A></LI>

<LI>

<A HREF="#I10">Mathematical Expressions</A></LI>

<LI>

<A HREF="#I11">Bitwise Operations</A></LI></UL>

<LI>

<A HREF="#I12">Statement Controls</A></LI></UL>

<LI>

<A HREF="#I13">Creating a Simple Program</A></LI>

<UL>

<LI>

<A HREF="#I14">Writing the Code</A></LI>

<LI>

<A HREF="#I15">Compiling the Program</A></LI>

<LI>

<A HREF="#I16">Executing the Program</A></LI></UL>

<LI>

<A HREF="#I17">Building Large Applications</A></LI>

<UL>

<LI>

<A HREF="#I18">Making Libraries with ar</A></LI>

<LI>

<A HREF="#I19">Building Large Applications with make</A></LI></UL>

<LI>

<A HREF="#I20">Debugging Tools</A></LI>

<LI>

<A HREF="#I21">Summary</A></LI></UL></UL></UL>



<H2 ALIGN="CENTER">

<CENTER><A ID="I1" NAME="I1">

<FONT SIZE=5><A ID="I2" NAME="I2"></A><B>17 &#151; The C Programming Language</B>

<BR></FONT></A></CENTER></H2>

<H5 ALIGN="CENTER">

<CENTER><A ID="I3" NAME="I3">

<FONT SIZE=3><B>By James Armstrong</B>

<BR></FONT></A></CENTER></H5>

<P>C is the programming language most frequently associated with UNIX. Since the 1970s, the bulk of the operating system and applications have been written in C. This is one of the major reasons why UNIX is a portable operating system.

<BR></P>

<H3 ALIGN="CENTER">

<CENTER><A ID="I4" NAME="I4">

<FONT SIZE=4><B>The History of C</B>

<BR></FONT></A></CENTER></H3>

<P>C was first designed by Dennis Ritchie for use with UNIX on DEC PDP-11 computers. The language evolved from Martin Richard's BCPL, and one of its earlier forms was the B language, which was written by Ken Thompson for the DEC PDP-7. The first book on C 

was The C Programming Language by Brian Kernighan and Dennis Ritchie, published in 1978.

<BR></P>

<P>In 1983, the American National Standards Institute established a committee to standardize the definition of C. Termed ANSI C, it is the recognized standard for the language grammar and a core set of libraries. The syntax is slightly different from the 
original C language, which is frequently called K&amp;R&#151;for Kernighan and Ritchie.

<BR></P>

<H3 ALIGN="CENTER">

<CENTER><A ID="I5" NAME="I5">

<FONT SIZE=4><B>Creating, Compiling, and Executing Your First Program</B>

<BR></FONT></A></CENTER></H3>

<P>The development of a C program is an iterative procedure. Many UNIX tools are involved in this four-step process. They are familiar to software developers:

<BR></P>

<OL>

<LI>Using an editor, write the code into a text file.

<BR>

<BR></LI>

<LI>Compile the program.

<BR>

<BR></LI>

<LI>Execute the program.

<BR>

<BR></LI>

<LI>Debug the program.

<BR>

<BR></LI></OL>

<P>The first two steps are repeated until the program compiles successfully. Then the execution and debugging begin. Many of the concepts presented may seem strange to non-programmers. This chapter endeavors to introduce C as a programming language.

<BR></P>

<P>The typical first C program is almost a clich&#233;. It is the &quot;Hello, World&quot; program, and it prints the simple line Hello, World. Listing 17.1 is the source of the program.

<BR></P>

<UL>

<LH><B>Listing 17.1. Source of </B><B>Hello World</B><B>.</B></LH></UL>

<PRE>main()

{

printf(&quot;Hello, World\n&quot;);

}</PRE>

<P>This program can be compiled and executed as follows:

<BR></P>

<PRE>$ cc hello.c

$ a.out

Hello, World

$</PRE>

<P>The program is compiled with the cc command, which creates a program a.out if the code is correct. Just typing a.out will run the program. The program includes only one function, main. Every C program must have a main function; it is where the program's 

execution begins. The only statement is a call to the printf library function, which passes the string Hello, World\n. (Functions are described in detail later in this chapter.) The last two characters of the string, \n, represent the carriage return-line 

feed character.

<BR></P>

<H3 ALIGN="CENTER">

<CENTER><A ID="I6" NAME="I6">

<FONT SIZE=4><B>An Overview of the C Language</B>

<BR></FONT></A></CENTER></H3>

<P>As with all programming languages, C programs must follow rules. These rules describe how a program should appear, and what those words and symbols mean. This is the syntax of a programming language. Think of a program as a story. Each sentence must 
have a noun and a verb. Sentences form paragraphs, and the paragraphs tell the story. Similarly, C statements can build into functions and programs.

<BR></P>

<P>For more information about programming in C, I recommend the following books from Sams Publishing:

<BR></P>

<UL>

<LI>Teach Yourself C in 21 Days by Peter Aitken and Bradley Jones

<BR>

<BR></LI>

<LI>Programming in ANSI C by Stephen G. Kochan

<BR>

<BR></LI></UL>

<H4 ALIGN="CENTER">

<CENTER><A ID="I7" NAME="I7">

<FONT SIZE=3><B>Elementary C Syntax</B>

<BR></FONT></A></CENTER></H4>

<P>Like all languages, C deals primarily with the manipulation and presentation of data. BCPL deals with data as data. C, however, goes one step further to use the concept of data types. The basic data types are character, integer, and floating point 
numbers. Other data types are built from these three basic types.

<BR></P>

<P>Integers are the basic mathematical data type. They can be classified as long and short integers, and the size is implementation-dependent. With a few exceptions, integers are four bytes in length, and they can range from 2,147,483,648 to 2,147,483,647. 

In ANSI C, these values are defined in a header&#151;limit.h&#151;as INT_MIN and INT_MAX. The qualifier unsigned moves the range one bit higher, to the equivalent of INT_MAX-INT_MIN.

<BR></P>

<P>Floating point numbers are used for more complicated mathematics. Integer mathematics is limited to integer results. With integers, 3/2 equals 1. Floating point numbers give a greater amount of precision to mathematical calculations: 3/2 equals 1.5. 
Floating point numbers can be represented by a decimal number, such as 687.534, or with scientific notation: 8.87534E+2. For larger numbers, scientific notation is preferred. For even greater precision, the type double provides a greater range. Again, 
specific ranges are implementation-dependent.

<BR></P>

<P>Characters are usually implemented as single bytes, although some international character sets require two bytes. One common set of character representations is ASCII, and is found on most U.S. computers.

<BR></P>

<P>An array is used for a sequence of values that are often position-dependent. An array is useful when a range of values of a given type is needed. Related to the array is the pointer. Variables are stored in memory, and a pointer is the physical address 

of that memory. In a sense, a pointer and an array are similar, except when a program is invoked. The space needed for the data of an array is allocated when the routine that needs the space is invoked. For a pointer, the space must be allocated by the 
programmer, or the variable must be assigned by dereferencing a variable. The ampersand is used to indicate dereferencing, and an asterisk is used to when the value pointed at is required. Here are some sample declarations:

<BR></P>

<TABLE BORDER>

<TR>

<TD>

<P>int i;</P>

<TD>

<P>Declares an integer</P>

<TR>

<TD>

<P>char c;</P>

<TD>

<P>Declares a character</P>

<TR>

<TD>

<P>char *ptr;</P>

<TD>

<P>Declares a pointer to a character</P>

<TR>

<TD>

<P>double temp[16];</P>

<TD>

<P>Declares an array of double-precision floating point numbers with 16 values</P></TABLE>

<P>Listing 17.2 shows an example of a program with pointers.

<BR></P>

<UL>

<LH><B>Listing 17.2. An example of a program with pointers.</B></LH></UL>

<PRE>int i;

int *ptr;

i=5;

ptr = &amp;i;

printf(&quot;%d %x %d\n&quot;, i,ptr,*ptr);

output is: 5 f7fffa6c 5</PRE>

<HR ALIGN=CENTER>

<NOTE>

<IMG SRC="note.gif" WIDTH = 35 HEIGHT = 35><B>NOTE:</B> A pointer is just a memory address and will tell you the address of any variable.

<BR></NOTE>

<HR ALIGN=CENTER>

<P>There is no specific type for a string. An array of characters is used to represent strings. They can be printed using an %s flag, instead of %c.

<BR></P>

<P>Simple output is created by the printf function. printf takes a format string and the list of arguments to be printed. A complete set of format options is presented in Table 17.1. Format options can be modified with sizes. Check the documentation for 
the full specification.

<BR></P>

<UL>

<LH><B>Table 17.1. Format conversions for </B><B>printf</B><B>.</B>

<BR></LH></UL>

<TABLE BORDER>

<TR>

<TD>

<PRE><I>Conversion</I>

<BR></PRE>

<TD>

<PRE><I>Meaning</I>

<BR></PRE>

<TR>

<TD>

<P>%%</P>

<TD>

<P>Percentage sign</P>

<TR>

<TD>

<P>%E</P>

<TD>

<P>Double (scientific notation)</P>

<TR>

<TD>

<P>%G</P>

<TD>

<P>Double (format depends on value)</P>

<TR>

<TD>

<P>%X</P>

<TD>

<P>Hexadecimal (letters are capitalized)</P>

<TR>

<TD>

<P>%c</P>

<TD>

<P>Single character</P>

<TR>

<TD>

<P>%d</P>

<TD>

<P>Integer</P>

<TR>

<TD>

<P>%e</P>

<TD>

<P>Double (scientific notation)</P>

<TR>

<TD>

<P>%f</P>

<TD>

<P>Double of the form mmm.ddd</P>

<TR>

<TD>

<P>%g</P>

<TD>

<P>Double (format depends on value)</P>

<TR>

<TD>

<P>%i</P>

<TD>

<P>Integer</P>

<TR>

<TD>

<P>%ld</P>

<TD>

<P>Long integer</P>

<TR>

<TD>

<P>%n</P>

<TD>

<P>Count of characters written in current printf</P>

<TR>

<TD>

<P>%o</P>

<TD>

<P>Octal</P>

<TR>

<TD>

<P>%p</P>

<TD>

<P>Print as a pointer</P>

<TR>

<TD>

<P>%s</P>

<TD>

<P>Character pointer (string)</P>

<TR>

<TD>

<P>%u</P>

<TD>

<P>Unsigned integer</P>

<TR>

<TD>

<P>%x</P>

<TD>

<P>Hexadecimal</P></TABLE>

<P>Some characters cannot be included easily in a program. New lines, for example, require a special escape sequence, because there cannot be an unescaped newline in a string. Table 17.2 contains a complete list of escape sequences.

<BR></P>

<UL>

<LH><B>Table 17.2. Escape characters for strings.</B>

<BR></LH></UL>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区不卡| 综合网在线视频| 99re成人在线| 日韩二区三区在线观看| 国产精品久久777777| 制服丝袜在线91| 色94色欧美sute亚洲线路一久| 久久国产精品99久久人人澡| ...xxx性欧美| 精品奇米国产一区二区三区| 欧美影视一区二区三区| 成人中文字幕电影| 免费成人在线播放| 一区二区三区中文字幕电影| 中文字幕免费不卡在线| 精品伦理精品一区| 欧美一级免费观看| 欧美在线不卡一区| 色综合天天综合网国产成人综合天 | 色综合久久久久久久久久久| 国产精品一区二区视频| 麻豆精品蜜桃视频网站| 亚洲成人你懂的| 一区二区在线看| 亚洲欧洲色图综合| 国产精品无人区| 久久久久国产精品厨房| 日韩三级免费观看| 欧美精品少妇一区二区三区| 91久久精品一区二区| 99vv1com这只有精品| 成人高清视频免费观看| 国产99一区视频免费| 国产成人午夜精品5599| 国产精品综合网| 国产米奇在线777精品观看| 久久精品国产精品亚洲综合| 婷婷中文字幕综合| 亚洲综合视频在线观看| 亚洲一区二区三区免费视频| 一区二区三区四区在线播放| 一区二区三区四区在线| 亚洲免费观看高清完整| 亚洲午夜视频在线| 亚洲成人动漫在线免费观看| 日韩精品一级中文字幕精品视频免费观看 | 国产一区二区在线观看免费| 精品中文字幕一区二区| 国产精品资源在线观看| 国产成人精品一区二| 国产99精品国产| 波多野结衣中文字幕一区| 不卡一二三区首页| 一本大道久久a久久精品综合| 91色|porny| 欧美日韩电影在线| 日韩精品一区二区三区中文精品| 26uuu久久天堂性欧美| 欧美国产日韩精品免费观看| 综合色天天鬼久久鬼色| 亚洲国产日韩一级| 美女爽到高潮91| 国产91丝袜在线播放九色| 一本大道久久a久久综合| 欧美在线视频你懂得| 欧美一区二区三区免费| 久久久久久99精品| 亚洲嫩草精品久久| 午夜精品福利一区二区蜜股av| 日本伊人午夜精品| 国产69精品久久久久777| 色天天综合色天天久久| 欧美一区二区三区播放老司机| 久久尤物电影视频在线观看| 亚洲色图制服丝袜| 美女精品一区二区| 99久久综合狠狠综合久久| 欧美剧情片在线观看| 久久精品这里都是精品| 一区二区三区国产| 久久电影网站中文字幕| 成人av片在线观看| 欧美精品久久久久久久久老牛影院| 精品国产一区二区三区久久影院 | 一区二区三区四区视频精品免费 | 国产欧美一区二区在线| 亚洲成人av电影| 国产精品亚洲人在线观看| 欧美最猛性xxxxx直播| 2014亚洲片线观看视频免费| 又紧又大又爽精品一区二区| 久久疯狂做爰流白浆xx| 欧美唯美清纯偷拍| 中文幕一区二区三区久久蜜桃| 日韩电影在线观看网站| 91在线精品一区二区| 精品日韩99亚洲| 亚洲一二三级电影| k8久久久一区二区三区| 日韩欧美国产综合| 亚洲一级二级在线| 成人小视频免费在线观看| 日韩免费一区二区| 亚洲自拍偷拍欧美| 成人激情免费网站| 精品久久一区二区| 亚洲成av人**亚洲成av**| 99久久夜色精品国产网站| 精品国一区二区三区| 亚洲成人av一区二区| 91美女在线看| 欧美国产日韩在线观看| 激情综合五月婷婷| 日韩精品中文字幕在线一区| 亚洲小说春色综合另类电影| 91丝袜美腿高跟国产极品老师 | 国产精品69毛片高清亚洲| 欧美一区二区三区视频免费| 亚洲一区二区三区自拍| 91视视频在线直接观看在线看网页在线看 | 欧美美女视频在线观看| 亚洲精品精品亚洲| 99精品视频一区| 久久精品一区二区| 精久久久久久久久久久| 欧美电影免费观看高清完整版在 | 亚洲国产精品久久艾草纯爱| 色噜噜狠狠色综合中国| 亚洲男人天堂av网| 97国产一区二区| 国产精品看片你懂得| av资源网一区| 日韩美女啊v在线免费观看| 99热这里都是精品| 亚洲三级电影网站| 91国偷自产一区二区三区成为亚洲经典 | 亚洲婷婷在线视频| 成人午夜激情在线| 中文字幕一区二区三区av| 成a人片亚洲日本久久| 综合激情成人伊人| 日本高清不卡在线观看| 亚洲一二三区视频在线观看| 欧美日韩国产高清一区| 蜜桃av一区二区| 久久久久久久久伊人| 国产成人av资源| 亚洲色图在线播放| 欧美在线小视频| 蜜臀久久99精品久久久久久9| 日韩欧美中文一区| 国产真实乱偷精品视频免| 国产亚洲欧美日韩俺去了| 成人午夜电影小说| 亚洲美女淫视频| 欧美精选一区二区| 狠狠网亚洲精品| 国产精品私人自拍| 日本电影亚洲天堂一区| 石原莉奈在线亚洲二区| 精品日韩在线观看| aaa国产一区| 亚洲一区二区av电影| 777a∨成人精品桃花网| 国产资源在线一区| 亚洲乱码精品一二三四区日韩在线 | 成人精品视频网站| 一区二区欧美国产| 日韩一区二区影院| 成人午夜电影小说| 午夜婷婷国产麻豆精品| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 国内精品免费**视频| 国产精品电影一区二区| 欧美日韩在线一区二区| 国产一区二区视频在线播放| 亚洲人123区| 欧美大片拔萝卜| 91丨porny丨户外露出| 麻豆精品一区二区三区| 中文字幕亚洲视频| 日韩一区二区在线观看| 91丝袜美女网| 九色综合狠狠综合久久| 亚洲精品国产精华液| 欧美成人午夜电影| 色综合天天性综合| 精品一区二区免费在线观看| 日韩毛片高清在线播放| 日韩女同互慰一区二区| 97精品视频在线观看自产线路二 | 91久久人澡人人添人人爽欧美| 黑人巨大精品欧美黑白配亚洲 | 狠狠色丁香婷婷综合久久片| 一二三区精品福利视频| 中文字幕av免费专区久久| 日韩一区二区精品| 色吧成人激情小说| 成人久久视频在线观看| 久久精品72免费观看|