Студопедия — 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; просмотров: 624. Нарушение авторских прав; Мы поможем в написании вашей работы!



Функция спроса населения на данный товар Функция спроса населения на данный товар: Qd=7-Р. Функция предложения: Qs= -5+2Р,где...

Аальтернативная стоимость. Кривая производственных возможностей В экономике Буридании есть 100 ед. труда с производительностью 4 м ткани или 2 кг мяса...

Вычисление основной дактилоскопической формулы Вычислением основной дактоформулы обычно занимается следователь. Для этого все десять пальцев разбиваются на пять пар...

Расчетные и графические задания Равновесный объем - это объем, определяемый равенством спроса и предложения...

Классификация ИС по признаку структурированности задач Так как основное назначение ИС – автоматизировать информационные процессы для решения определенных задач, то одна из основных классификаций – это классификация ИС по степени структурированности задач...

Внешняя политика России 1894- 1917 гг. Внешнюю политику Николая II и первый период его царствования определяли, по меньшей мере три важных фактора...

Оценка качества Анализ документации. Имеющийся рецепт, паспорт письменного контроля и номер лекарственной формы соответствуют друг другу. Ингредиенты совместимы, расчеты сделаны верно, паспорт письменного контроля выписан верно. Правильность упаковки и оформления....

ТРАНСПОРТНАЯ ИММОБИЛИЗАЦИЯ   Под транспортной иммобилизацией понимают мероприятия, направленные на обеспечение покоя в поврежденном участке тела и близлежащих к нему суставах на период перевозки пострадавшего в лечебное учреждение...

Кишечный шов (Ламбера, Альберта, Шмидена, Матешука) Кишечный шов– это способ соединения кишечной стенки. В основе кишечного шва лежит принцип футлярного строения кишечной стенки...

Принципы резекции желудка по типу Бильрот 1, Бильрот 2; операция Гофмейстера-Финстерера. Гастрэктомия Резекция желудка – удаление части желудка: а) дистальная – удаляют 2/3 желудка б) проксимальная – удаляют 95% желудка. Показания...

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