Студопедия

Главная страница Случайная страница

Разделы сайта

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






Characteristics of C programming language






Like most imperative languages in the ALGOL tradition, C has facilities for structured programming and allows lexical variable scope and recursion, while a static type system prevents many unintended operations. In C, all executable code is contained within subroutines, which are called " functions" (although not in the strict sense of functional programming). Function parameters are always passed by value. Pass-by-reference is simulated in C by explicitly passing pointer values. C program source text is free-format, using the semicolon as a statement terminator and curly braces for grouping blocks of statements.

The C language also exhibits the following more specific characteristics:

  • There are a small, fixed number of keywords, including a full set of flow of control primitives: for, if, while, switch, and do..while. There is basically one namespace, and user-defined names are not distinguished from keywords by any kind of sigil.
  • There are a large number of arithmetical and logical operators, such as +, +=, ++, &, ~, etc.
  • More than one assignment may be performed in a single statement.
  • Function return values can be ignored when not needed.
  • Typing is static, but weakly enforced: all data has a type, but implicit conversions can be performed; for instance, characters can be used as integers.
  • Declaration syntax mimics usage context. C has no " define" keyword; instead, a statement beginning with the name of a type is taken as a declaration.
  • Heterogeneous aggregate data types (struct) allow related data elements to be accessed, for example assigned, as a unit.
  • Array indexing is a secondary notion, defined in terms of pointer arithmetic. Unlike structs, arrays are not first-class objects; they cannot be assigned or compared using single built-in operators. There is no " array" keyword, in use or definition; instead, square brackets indicate arrays syntactically.
  • Enumerated types are possible with the enum keyword. They are not tagged, and are freely interconvertible with integers.
  • Strings are not a separate data type, but are conventionally implemented as null-terminated arrays of characters.
  • Low-level access to computer memory is possible by converting machine addresses to typed pointers.
  • Procedures (subroutines not returning values) are a special case of function, with a dummy return type void.
  • Functions may not be defined within the lexical scope of other functions.
  • Function and data pointers permit ad hoc run-time polymorphism.
  • A preprocessor performs macro definition, source code file inclusion, and conditional compilation.
  • Complex functionality such as I/O, string manipulation, and mathematical functions are consistently delegated to library routines.

(based on: https://en.wikipedia.org)

18. Find English equivalents in the text:

Засоби, область змінних, рекурсія, система статичної типізації даних, непередбачувані операції, підпрограми, передаватися за значенням, передача параметрів по посиланню, значення вказівника, крапка з комою, символ, що завершує твердження, фігурні дужки, ключові слова, базовий елемент, простір імен, знак (2), завдання, слабка типізація, ціле число, оголошення, гетерогенні сукупності типів даних (структури), масив індексів, взаємозамінний, рядки, зазвичай використовуються, порожній тип даних, спеціальний динамічний поліморфізм, макроозначення, включення файла з джерельним кодом, умовна компіляція, делегування математичних функцій бібліотекам

 

19. What words are defined? Choose them from the databank:

Databank: a primitive, a subroutine, a void, a declaration, a string, an operation, polymorphism, a statement, an array.

1) a set of instructions that performs a specific task for a main routine; 2) an action resulting from a single instruction; 3) an elementary instruction in a programming language; smth. stated; 4) a basic or fundamental unit of machine instruction or translation; 5) a programming language feature that allows values of different data types to be handled using a uniform interface; 6) a regular data structure in which individual elements may be located by reference to one or more integer index variables, syntactically indicated by square brackets; 7) a statement beginning with the name of a type; 8) null-terminated arrays of characters; 9) a dummy return type.

 

20. Make up word combinations:

1. to group a) pointer values
2. to exhibit b) to library routines
3. to mimic c) machine addresses
4. to assign d) examples
5. to convert e) lexical variable scope
6. to permit f) blocks of statements
7. to be delegated g) values
8. to allow h) usage context
9. to return i) ad hoc run-time polymorphism
10. to pass j) more specific characteristics

 

21. Complete the sentences with the suitable words. Guess them from the first letter:

Databank: assignments, operator, curly braces, declaration, integer, semicolon, void, arrays, keywords, conditional, loops, string, returns.

  1. Statements in most programming languages are terminated by a s________.
  2. I________ variables can be assigned using decimal (positive and negative), octal, and hexadecimal notations.
  3. A_______ can contain elements of any type that PHP can handle, including resources, objects, and even other arrays.
  4. The v_______ keyword denotes that a method does not have a return type.
  5. In programming languages, a d________ specifies the identifier, type, and other aspects of language elements such as variables and functions.
  6. Tough a________ puzzle inquisitive minds.
  7. A variable’s value is interpolated into the s_____ by means of using double-quotes.
  8. In terms of k_______ and language syntax, PHP is similar to most high level languages that follow the C style syntax: if c_______, for and while l______, and function r_______.
  9. Programers use sections of code that are enclosed in c____b_____ to limit the scope of declarations and to act as a single statement for control structures.
  10. C uses the = o______, reserved in mathematics to express equality and to indicate assignment.





© 2023 :: MyLektsii.ru :: Мои Лекции
Все материалы представленные на сайте исключительно с целью ознакомления читателями и не преследуют коммерческих целей или нарушение авторских прав.
Копирование текстов разрешено только с указанием индексируемой ссылки на источник.