( )
| : | |
|---|---|
| : | |
| : |
19691973 |
| (): | |
| : | |
| : | |
| : |
GCC, TCC, Turbo C, Watcom, Oracle Solaris Studio C |
| : |
«K&R» C (1978) |
(. C) , 1970- Bell Labs . UNIX. . . . . , , . .
|
|
[]
[]
. , , , . , , . . , . « » « », , . , , . , , .
. (, , ). , , . , , .
( UNIX, ) , . , .
, :
[]
89 32 :
auto |
double |
int |
struct |
break |
else |
long |
switch |
case |
enum |
register |
typedef |
char |
extern |
return |
union |
const |
float |
short |
unsigned |
continue |
for |
signed |
void |
default |
goto |
sizeof |
volatile |
do |
if |
static |
while |
C99 :
_Bool |
inline |
_Complex |
_Imaginary |
restrict |
[] «Hello, world!»
, « » , . «Hello, world!» (, , , , - , , ).
main() { printf("Hello, World!\n"); }
, , ANSI C. , , C99, int , ( main ). , :
#include <stdio.h> int main(void) { printf("Hello, World!\n"); return 0; }
#include, , , . stdio.h. stdio.h .
«» printf. stdio.h , , . , "Hello, World!\n. \n « », . printf int, ( ).
return (main ), , return ( 0). main, , . main. C99, return 0 main ( return main return 0;).
[]
, /* */ ( ), . . , C99, , //
[]
, , . (short int, long int), (signed) (unsigned), (float, double), , (enum) - (struct). , (union), , ( ), , ( - , ).
[]
- : ; . « » (. undefined behaviour). .
- : ; , , , .
- :
malloc,realloc,callocfree, .free.
. , , , , . , , . , . .
[]
ASCII, ( $ @ `). , , (), (), [], {}. , , .
[]
, . : « , , : , ». , . . . , .
. , , . , , , ; , , . , , , ( ) «». , , , , «» (garbage), , « » . .
, , . , , , . , . , .
, , free(). , , . . , , . - , -, . . , , C++, , C99.
. , , . , , . , printf , , , . , printf, , . , printf, , .
. , , , , .
[]
[]
Bell Labs 1969 1973 . , 1972 . «» (C ), «» (B ). . BCPL, Bon, , .
, UNIX, :
1973 , UNIX, PDP-11/20, . , , ; Multics ( /1) TRIPOS ( BCPL).
[] K&R C
1978 « ». , «K&R», . , , «K&R C». ( ANSI C, .)
K&R :
- (
struct); - (
long int); - (
unsigned int); -
+=(=+, ,i =+ 10i = +10).
K&R C , . ANSI C, , , , ANSI C, K&R C ANSI C.
K&R C , AT&T :
[] ISO C
1970- . 1980- IBM PC, . Bell Labs - . , , C++, , [2] , UNIX- .
1983 (ANSI) . 1989 « » ANSI X3.159-1989. ANSI C C89. 1990 ANSI C (ISO) ISO/IEC 9899:1990.
ANSI C . , , ANSI C. , , , . , , , :
[] C99
ANSI , ++ ( 1995 , ). 1990- , ISO 9899:1999 1999 . «C99». 2000 ANSI.
C99:
- (
inline); - ( C++);
- ,
long long int( 32- 64- ),_Boolcomplex; - ;
- (
restrict); - :
struct { int x, y, z; } point = { .y=10, .z=20, .x=30 }; - ,
//, C++ ( ); - ,
snprintf; - ,
stdint.h.
C99 [?] . GCC[3], Sun Microsystems C99, Borland Microsoft , , , .
[] C11
8 2011 (ISO/IEC 9899:2011)[4]. GCC[5] Clang[6]. :
- ;
- ;
- (type-generic expressions, );
- ( );
- ;
- (static assertions);
-
gets(gets_s); -
quick_exit; -
_Noreturn; - .
[] C++
C++ . C++ , . C99 C++ . , C++, , , , .
, [?]:
inlineC++, ( ). , , C++ ( ) , , . - .- C++,
boolC99stdbool.h. C99_Bool. (C89) , ( , ) . - ( ) :
intcharC++.sizeof('a') == sizeof(int), C++sizeof('a') == sizeof(char).[7] - C99, ,
restrict, C++.
C++ :
- ;
- ,
//; - ,
void,constint.
[]
« C» . , . ISBN 5-9518-0048-X
| , | 16 | |||
| a[k] | 16 | |||
| f() | 16 | |||
| . | 16 | |||
| -> | 16 | |||
| ++ -- | 16 | |||
| ( ) {init} | (C99) | 16 | ||
| ++ -- | 15 | |||
| sizeof | 15 | |||
| ~ | 15 | |||
| ! | 15 | |||
| - + | , | 15 | ||
| & | 15 | |||
| * | () | 15 | ||
| ( ) | 14 | |||
| * / % | 13 | |||
| + - | 12 | |||
| << >> | 11 | |||
| < > <= >= | 10 | |||
| == != | / | 9 | ||
| & | 8 | |||
| ^ | 7 | |||
| | | 6 | |||
| && | 5 | |||
| || | 4 | |||
| ? : | 3 | |||
| = += -= *= /= %= <<= >>= &= ^= |= | 2 | |||
| , | 1 |
[] [8]
[]
:
- Clue[9] ANSI Lua, JavaScript, Perl, Java, Common Lisp.
- Alchemy[10] /C++ ActionScript Virtual Machine (AVM2). - Flash- Adobe AIR-.
- AMPC[11] Java.
- Emscripten[12] LLVM- (, C++) JavaScript.
[] .
[]
- : : № 0: INTUIT.ru
- Programming Community Index for April 2012
- Status of C99 features in GCC
- ISO/IEC 9899:2011 Information technology Programming languages C
- GCC 4.6 Release Series Changes, New Features, and Fixes GNU Project Free Software Foundation (FSF)
- LLVM 3.0 Release Notes
- Annex 0: Compatibility. 1.2. C++ and ISO C. Working Paper for Draft Proposed International Standard for Information Systems Programming Language C++ (2 1996). . 1.2.1p3 ( 3 1.2.1). 22 2011. 6 2009.
- ( C++) .
- Clue SourceForge.net
- Adobe Labs Alchemy
- Axiomatic Solutions Sdn Bhd
- Emscripten LLVM-to-JavaScript compiler
[]
- ., . = The C programming language. 2- . .: , 2007. . 304. ISBN 0-13-110362-8
- . C: , = C: The Complete Reference, 4th Edition. .: , 2010. . 704. ISBN 978-5-8459-1709-6
- . : = C Primer Plus. .: , 2006. . 960. ISBN 5-8459-0986-4
- . = Programming in C. 3- . .: , 2006. . 496. ISBN 0-672-32666-3
- . «» = C For Dummies. .: , 2006. . 352. ISBN 0-7645-7068-4
[]
| ? | |
| ? |
- ISO/IEC JTC1/SC22/WG14 official home (.). . 22 2011. 20 2009.
-
- WG14 N1124 (.). ISO/IEC 9899 Programming languages C Approved standards. ISO/IEC JTC1/SC22/WG14 (6 2005). ISO/IEC 9899:1999 (C99) + ISO/IEC 9899:1999 Cor. 1:2001(E) (TC1 Technical Corrigendum 1 2001 ) + ISO/IEC 9899:1999 Cor. 2:2004(E) (TC2 Technical Corrigendum 2 2004 ). 22 2011. 20 2009.
- C The ISO Standard Rationale, Revision 5.10 (.) ( 2004). C99. 22 2011. 20 2009.