⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index.html

📁 this is a mirrored site c-faq. thought might need offline
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3O//DTD W3 HTML 2.0//EN"><!-- This collection of hypertext pages is Copyright 1995-2005 by Steve Summit. --><!-- Content from the book "C Programming FAQs: Frequently Asked Questions" --><!-- (Addison-Wesley, 1995, ISBN 0-201-84519-9) is made available here by --><!-- permission of the author and the publisher as a service to the community. --><!-- It is intended to complement the use of the published text --><!-- and is protected by international copyright laws. --><!-- The on-line content may be accessed freely for personal use --><!-- but may not be published or retransmitted without explicit permission. --><!-- --><!-- this page built Sat Dec 24 21:47:46 2005 by faqproc version 2.7 --><!-- from source file ansi.sgml dated Wed Aug 11 00:43:45 2004 --><!-- corresponding to FAQ list version 4.0 --><html><!-- Mirrored from c-faq.com/ansi/index.html by HTTrack Website Copier/3.x [XR&CO'2008], Sat, 14 Mar 2009 07:55:23 GMT --><head><meta name=GENERATOR content="faqproc"><title>ANSI/ISO Standard C</title></head><body bgcolor="#ffffff">&nbsp;<a href="../index-2.html"><img src="../images/buttontop.gif" alt="top/contents"></a><a href="../search.html"><img src="../images/buttonsrch.gif" alt="search"></a><hr><H1>11. ANSI/ISO Standard C</H1><p><a href="ansi1.html" rel=subdocument>11.1</a>What is the ``ANSI C Standard?''</p><p><a href="avail.html" rel=subdocument>11.2</a>How can I get a copy of the Standard?</p><p><a href="updates.html" rel=subdocument>11.2b</a>Where can I get information about updates to the Standard?</p><p><a href="argpromos.html" rel=subdocument>11.3</a>My ANSI compilercomplains about a mismatch when it sees<pre>	extern int func(float);	int func(x)	float x;	{ ...</pre></p><p><a href="mixoldandnew.html" rel=subdocument>11.4</a>Can you mix old-style and new-stylefunction syntax?</p><p><a href="structinproto.html" rel=subdocument>11.5</a>Why does the declaration<pre>extern int f(struct x *p);</pre>give mean obscurewarning messageabout``struct x declared inside parameter list''?</p><p><a href="varargproto.html" rel=subdocument>11.6</a>I had a frustrating problem which turned out to be caused by the line<pre>	printf("%d", n);</pre>where <TT>n</TT> was actually a <TT>long&nbsp;int</TT>.I thought that ANSI function prototypeswere supposed to guard against argument type mismatches like this.</p><p><a href="varargproto2.html" rel=subdocument>11.7</a>I heard that you have to <TT>#include</TT> <TT>&lt;stdio.h&gt;</TT>before calling <TT>printf</TT>.Why?</p><p><a href="constasconst.html" rel=subdocument>11.8</a>I don't understand why I can'tuse <TT>const</TT> values in initializers and arraydimensions,as in<pre>	const int n = 5;	int a[n];</pre></p><p><a href="strlitnotconst.html" rel=subdocument>11.8b</a>If you can't modify string literals,why aren't they defined as beingarrays of <TT>const</TT> characters?</p><p><a href="constptrconst.html" rel=subdocument>11.9</a>What's the difference between<TT>const&nbsp;char&nbsp;*p</TT>,<TT>char&nbsp;const&nbsp;*p</TT>,and <TT>char&nbsp;*&nbsp;const&nbsp;p</TT>?</p><p><a href="constmismatch.html" rel=subdocument>11.10</a>Why can't I pass a <TT>char&nbsp;**</TT> to a function which expects a<TT>const&nbsp;char&nbsp;**</TT>?</p><p><a href="typedefconst.html" rel=subdocument>11.11</a>I've gotthe declarations<pre>	typedef char *charp;	const charp p;</pre>Why is <TT>p</TT> turning out <TT>const</TT>,instead of the characters pointed to?</p><p><a href="constvsdefine2.html" rel=subdocument>11.11b</a>What's the difference between<pre>	const MAXSIZE = 100;</pre><pre>and</pre><pre>	#define MAXSIZE 100</pre></p><p><a href="maindecl.html" rel=subdocument>11.12a</a>What's the correct declaration of <TT>main()</TT>?</p><p><a href="voidmain.html" rel=subdocument>11.12b</a>Can I declare <TT>main</TT> as <TT>void</TT>,to shut off these annoying``main returns no value'' messages?</p><p><a href="envp.html" rel=subdocument>11.13</a>But what about <TT>main</TT>'s third argument,<TT>envp</TT>?</p><p><a href="voidmain3.html" rel=subdocument>11.14a</a>I believe that declaring <TT>void&nbsp;main()</TT> can't fail,since I'm calling <TT>exit</TT> instead of returning,and anyway my operating system ignores a program's exit/return status.</p><p><a href="voidmainexamp.html" rel=subdocument>11.14b</a>So what could go wrong?Are therereally anysystems where <TT>void&nbsp;main()</TT> doesn't work?</p><p><a href="voidmainbooks.html" rel=subdocument>11.15</a>The book I've been using,<I>C Programingfor the Compleat Idiot</I>,always uses <TT>void&nbsp;main()</TT>.</p><p><a href="exitvsreturn.html" rel=subdocument>11.16</a>Is <TT>exit(status)</TT> truly equivalentto returning the same <TT>status</TT> from <TT>main</TT>?</p><p><a href="stringize.html" rel=subdocument>11.17</a>I'm trying to usethe ANSI ``stringizing'' preprocessing operator`<TT>#</TT>'to insert the value of a symbolic constant into a message,but it keepsstringizing the macro's name rather than itsvalue.</p><p><a href="macstrexp.html" rel=subdocument>11.18</a>What does the message``warning: macro replacement within a string literal''mean?</p><p><a href="ifdefsyntax.html" rel=subdocument>11.19</a>I'm getting strange syntax errors insidelinesI've<TT>#ifdef</TT>fed out.</p><p><a href="pragma.html" rel=subdocument>11.20</a>What are <TT>#pragma</TT>s and what are they good for?</p><p><a href="pragmaonce.html" rel=subdocument>11.21</a>What does ``<TT>#pragma&nbsp;once</TT>'' mean?I found it in some header files.</p><p><a href="nonstrings.html" rel=subdocument>11.22</a>Is <TT>char&nbsp;a[3]&nbsp;=&nbsp;"abc";</TT> legal?What does it mean?</p><p><a href="aryvsadr.html" rel=subdocument>11.23</a>Since array references decay into pointers,if <TT>arr</TT> is an array,what'sthe difference between<TT>arr</TT> and <TT>&amp;arr</TT>?</p><p><a href="voidparith.html" rel=subdocument>11.24</a>Why can't I perform arithmetic on a <TT>void&nbsp;*</TT> pointer?</p><p><a href="memmove.html" rel=subdocument>11.25</a>What's the difference between<TT>memcpy</TT> and<TT>memmove</TT>?</p><p><a href="malloc0.html" rel=subdocument>11.26</a>What should <TT>malloc(0)</TT> do?Return a null pointer or a pointer to 0 bytes?</p><p><a href="extidsignif.html" rel=subdocument>11.27</a>Why does the ANSI Standardplace limits onthe lengthand case-significanceofexternal identifiers?</p><p><a href="noalias.html" rel=subdocument>11.28</a>What was <TT>noalias</TT> and what ever happened to it?</p><p><a href="preansi.html" rel=subdocument>11.29a</a>My compiler is rejecting the simplest possible test programs,with all kinds of syntax errors.It's complaining about thefirst line of<pre>	main(int argc, char **argv)	{		return 0;	}</pre></p><p><a href="preansi2.html" rel=subdocument>11.29b</a>What does the message``Automatic aggregate intialization is an ANSI feature''mean?My compiler is complaining about valid ANSI code.</p><p><a href="preansilib.html" rel=subdocument>11.30</a>Why are some ANSI/ISO Standard library functions showing up asundefined, even though I've got an ANSI compiler?</p><p><a href="cproto.html" rel=subdocument>11.31</a>Does anyone have a tool for converting old-style C programs toANSI C,or vice versa,or for automatically generating prototypes?</p><p><a href="extensions.html" rel=subdocument>11.32</a>Why won'tthe Frobozz Magic C Compiler,which claims to be ANSI compliant,accept this code?I know that the code is ANSI, because <TT>gcc</TT> accepts it.</p><p><a href="undef.html" rel=subdocument>11.33</a>People seem to make a point of distinguishingbetweenimplementation-defined,unspecified,andundefinedbehavior.What do these mean?</p><p><a href="compliance.html" rel=subdocument>11.33b</a>What does it really mean for a program to be``legal''or``valid''or``conforming''?</p><p><a href="appalled.html" rel=subdocument>11.34</a>I'm appalled that the ANSI Standard leaves so many issues undefined.Isn't a Standard's whole job to standardize these things?</p><p><a href="experiment.html" rel=subdocument>11.35</a>People keep saying that the behaviorof <TT>i&nbsp;=&nbsp;i++</TT>is undefined,butI just triediton an ANSI-conforming compiler,and got the results I expected.</p><hr><p><a href="../index-2.html">top</a></p><p><a href="../questions.html"><img src="../images/buttontop.gif" alt="contents"></a><a href="../search.html"><img src="../images/buttonsrch.gif" alt="search"></a><br><a href="../about.html">about this FAQ list</a>&nbsp;<a href="../eskimo.html">about eskimo</a>&nbsp;<a href="../search.html">search</a>&nbsp;<a href="../feedback.html">feedback</a>&nbsp;<a href="copyright.html">copyright</a><p>Hosted by<a href="http://www.eskimo.com/"><img src="../../www.eskimo.com/img/link/eskitiny.gif" alt="Eskimo North"></a></p></body><!-- Mirrored from c-faq.com/ansi/index.html by HTTrack Website Copier/3.x [XR&CO'2008], Sat, 14 Mar 2009 07:55:39 GMT --></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -