Hub Nexus

Все издания

C programming

An open textbook from Wikibooks, a chapter a page, in reading order.

18 страницОбновлено

Письмо приходит, когда в издание добавляют страницу. Когда страница меняется — нет.

Версия: 1CC BY-SA 4.0
[C]( is the most commonly used programming language for writing [operating systems]( The first operating system written in C was [Unix]( Later operating systems like [GNU/Linux]( were all written in C. Not only is C the language of operating systems, but it is also the precursor and inspiration for
Версия: 1CC BY-SA 4.0
The Algorithmic Language ([Algol 58]( was derived from Fortran in 1958 and evolved into [Algol 60]( in 1960. The [Combined Programming Language (CPL)]( was then created out of Algol 60 in 1963. In 1967, it evolved into [Basic CPL]( (BCPL), which was the basis for [B]( which was created in 1971, and
Версия: 1CC BY-SA 4.0
It's also assumed you have some experience interacting with your operating system through a terminal window using its **command line interface.** If you aren't sure what this means, consider seeking out a tutorial for your chosen platform that can get you comfortable with getting around your compute
Версия: 1CC BY-SA 4.0
Therefore, you can use Dev C++ for C development. However, Dev C++ is not the compiler. It is designed to use the [MinGW]( or [Cygwin]( versions of [GCC]( - both of which can be obtained as part of the Dev C++ package, although they are completely different projects. Dev C++ simply provides an edito
Версия: 1CC BY-SA 4.0
Though your compiler understands it, you can only guess at what the code, sprinkled with some familiar English words, might do. One of your first jobs as a new programmer will be to learn the many "words" and symbols of the C programming language, the language your compiler understands. Once you lea
Версия: 1CC BY-SA 4.0
Before learning C syntax and programming constructs, it is important to learn the meaning of a few key terms that are central in understanding C, as well as the basic structure of a C program. So what is in a block? Generally, a block consists of executable statements. ## Statements A statement can
Версия: 1CC BY-SA 4.0
Having covered the basic concepts of C programming, we can now briefly discuss the process of compilation. Like any programming language, C by itself is completely incomprehensible to a [microprocessor]( Its purpose is to provide an intuitive way for humans to provide instructions that can be easily
Версия: 1CC BY-SA 4.0
Machines process things. We feed stuff into a machine and get different stuff out. A saw turns trees into planks. An internal combustion engine turns gasoline into rotational energy.
Версия: 1CC BY-SA 4.0
C programming, Variables
Версия: 1CC BY-SA 4.0
Now that we can create variables, let's learn how to fill those variables with input from the user. Like the output functions from [Simple output]( these input functions are declared in stdio.h, part of the C standard library. ## Input using scanf() The scanf() function is the input method equivalen
Версия: 1CC BY-SA 4.0
Its type depends on its form and value. The types of constants are character constants (e.g. ' ' is a space), integer constants (e.g. 2), floating-point constants (e.g.
Версия: 1CC BY-SA 4.0
C programming, Arrays and strings
Версия: 1CC BY-SA 4.0
C programming, Program flow control
Версия: 1CC BY-SA 4.0
In C programming, all executable code resides within a **function**. Note that other programming languages may distinguish between a "function", "subroutine", "subprogram", "procedure", or "method" -- in C, these are all functions. Functions are a fundamental feature of any high level programming la
Версия: 1CC BY-SA 4.0
A library in C is a collection of header files, exposed for use by other programs. The library therefore consists of an interface expressed in a .h file (named the "header") and an implementation expressed in a .c file. This .c file might be precompiled or otherwise inaccessible, or it might be avai
Версия: 1CC BY-SA 4.0
Why doesn't it work? ### Data types - List at least three data types in C On your computer, how much memory does each require? - Which ones can be used in place of another? Why?
Версия: 1CC BY-SA 4.0
In the chapter [Variables]( we looked at the primitive data types. However, more advanced data types allow us greater flexibility in managing data in our program. ## Structs Structs are data types made of variables of other data types (possibly including other structs). They are used to group pieces
Версия: 1CC BY-SA 4.0
C programming, Pointers and arrays

Поддержать издание

Ежемесячно, через Stripe. После комиссии Stripe и 14% Hub Nexus половина каждого платежа идёт кураторам, половина — авторам страниц в издании, по числу написанных ими страниц.