Студопедия — C PROGRAMMING LANGUAGE
Студопедия Главная Случайная страница Обратная связь

Разделы: Автомобили Астрономия Биология География Дом и сад Другие языки Другое Информатика История Культура Литература Логика Математика Медицина Металлургия Механика Образование Охрана труда Педагогика Политика Право Психология Религия Риторика Социология Спорт Строительство Технология Туризм Физика Философия Финансы Химия Черчение Экология Экономика Электроника

C PROGRAMMING LANGUAGE






 

The C programming language is a standardized imperative computer programming language developed in the early 1970s by Dennis Ritchie for use on the Unix operating system. It has since spread to many other operating systems, and is one of the most widely used programming languages. C is prized for its efficiency, and is the most popular programming language for writing system software, though it is also used for writing applications. It is also commonly used in computer science education, despite not being designed for novices.

C is a relatively minimalistic programming language. Among its design goals was that it be straightforwardly compilable by a single pass compiler — that is, that just a few machine language instructions would be required for each of its core language elements, without extensive run-time support It is quite possible to write C code at a low level of abstraction analogous to assembly language; in fact C is sometimes referred to (and not always pejoratively) as "high-level assembly" or "portable assembly". In part due to its relatively low level and modest feature set, C compilers can be developed comparatively easily. The language has therefore become available on a very wide range of platforms (probably more than for any other programming language in existence). Furthermore, despite its low-level nature, the language was designed to enable (and to encourage) machine-independent programming. A standards compliant and portably written C program can therefore be compiled for a very wide variety of computers.

C was originally developed (along with the Unix operating system with which it has long been associated) by programmers and for programmers, with few users other than its own designers in mind. Nevertheless, it has achieved very widespread popularity, finding use in contexts far beyond its initial systems-programming roots.

 

C has the following important features:

A simple core language, with important functionality such as math functions and file handling provided by sets of library routines instead

Focus on the procedural programming paradigm, with facilities for programming in a structured style

A type system which prevents many operations that are not meaningful

Use of a preprocessor language, the C preprocessor, for tasks such as defining macros and including multiple source code files

Low-level access to computer memory via the use of pointers

A minimalistic set of keywords

Parameters that are passed by value. Pass-by-reference semantics may be simulated by explicitly passing pointer values.

Function pointers and static variables, which allow for a rudimentary form of closures and runtime polymorphism

Lexical variable scope

Records, or user-defined aggregate datatypes (structs) which allow related data to be combined and manipulated as a whole

 

Some features that C lacks that are found in other languages include:

Automatic garbage collection

Language support for object-oriented programming, although the original implementations for C++ was a preprocessor that translated C++ into C source code.

Closures

Nested functions, though GCC has this feature as an extension.

Compile-time polymorphism in the form of function overloading, operator overloading, and there is only rudimentary language support for generic programming

Native support for multithreading and networking

Although the list of useful features C lacks is long, this has in a way been important to its acceptance, because it allows new compilers to be written quickly for it on new platforms, keeps the programmer in close control of what the program is doing, and allows solutions most natural for the particular platform. This is what often allows C code to run more efficiently than many other languages. Typically only hand-tuned assembly language code runs faster, since it has full control of the machine, but advances in C compilers and new complexity in modern processors have gradually narrowed this gap.

In some cases, a missing feature can be approximated within C. For example, the original implementation of C++ consisted of a preprocessor that translated the C++ syntax into C source code. Most object oriented functions include a special pointer, usually named "this", which refers to the current object. By passing this pointer as a function argument in C, the same functionality can be performed in C. C is used as an intermediate language by some high-level languages (Eiffel, Sather, Esterel) which do not output object or machine code, but output C source code only, to submit to a C compiler, which then outputs finished object or machine code. This is done to gain portability and optimization. C compilers exist for most or all processors and operating systems, and most C compilers output well optimized object or machine code. Thus, any language that outputs C source code suddenly becomes very portable, and able to yield optimized object or machine code. Unfortunately, C is designed as a programming language, not as a compiler target language, so is not ideal for use as an intermediate language, leading to development of C-based intermediate languages.







Дата добавления: 2015-10-15; просмотров: 626. Нарушение авторских прав; Мы поможем в написании вашей работы!



Композиция из абстрактных геометрических фигур Данная композиция состоит из линий, штриховки, абстрактных геометрических форм...

Важнейшие способы обработки и анализа рядов динамики Не во всех случаях эмпирические данные рядов динамики позволяют определить тенденцию изменения явления во времени...

ТЕОРЕТИЧЕСКАЯ МЕХАНИКА Статика является частью теоретической механики, изучающей условия, при ко­торых тело находится под действием заданной системы сил...

Теория усилителей. Схема Основная масса современных аналоговых и аналого-цифровых электронных устройств выполняется на специализированных микросхемах...

Гальванического элемента При контакте двух любых фаз на границе их раздела возникает двойной электрический слой (ДЭС), состоящий из равных по величине, но противоположных по знаку электрических зарядов...

Сущность, виды и функции маркетинга персонала Перснал-маркетинг является новым понятием. В мировой практике маркетинга и управления персоналом он выделился в отдельное направление лишь в начале 90-х гг.XX века...

Разработка товарной и ценовой стратегии фирмы на российском рынке хлебопродуктов В начале 1994 г. английская фирма МОНО совместно с бельгийской ПЮРАТОС приняла решение о начале совместного проекта на российском рынке. Эти фирмы ведут деятельность в сопредельных сферах производства хлебопродуктов. МОНО – крупнейший в Великобритании...

Методика исследования периферических лимфатических узлов. Исследование периферических лимфатических узлов производится с помощью осмотра и пальпации...

Роль органов чувств в ориентировке слепых Процесс ориентации протекает на основе совместной, интегративной деятельности сохранных анализаторов, каждый из которых при определенных объективных условиях может выступать как ведущий...

Лечебно-охранительный режим, его элементы и значение.   Терапевтическое воздействие на пациента подразумевает не только использование всех видов лечения, но и применение лечебно-охранительного режима – соблюдение условий поведения, способствующих выздоровлению...

Studopedia.info - Студопедия - 2014-2024 год . (0.008 сек.) русская версия | украинская версия