Programming in D / Перевод

→Macros:
SUBTITLE=Standard Input and Output Streams

DESCRIPTION=D's standard input and output streams stdin and stdout.

KEYWORDS=d programming language tutorial book stdin stdout
0 Macros:
SUBTITLE=Стандартные потоки ввода и вывода

DESCRIPTION=Стандартные потоки ввода и вывода языка D - stdin и stdout.

KEYWORDS=язык программирования d учебник книга stdin stdout
→$(PROBLEM_TEK
$(P
Observe that $(C stdout.write) works the same as $(C write).
))
0 $(PROBLEM_TEK
$(P
Проверьте и убедитесь что $(C stdout.write) работает так же как и $(C write).
))
→---
import std.stdio;

void main() {
$(HILITE stdout.)writeln("Hello, World!");
}
---
0 ---
import std.stdio;

void main() {
$(HILITE stdout.)writeln("Здравствуй, мир!");
}
---
→Accordingly, the $(I hello world) program can also be written as follows:
)
0 Так-что программа «Здравствуй, мир!» может быть записана и так:
)
→Similarly, $(C write) is short for $(C stdout.write).
0 Также $(C write) - это сокращение для $(C stdout.write).
→$(P
$(C writeln) that we've been using in the previous chapters is actually short for $(C stdout.writeln).
0 $(P
Функция $(C writeln), которой мы пользовались в предыдущих главах, это сокращенный вариант записи $(C stdout.writeln).
→Because $(C stdin)'s reading methods and $(C stdout)'s writing methods are used very commonly, those operations can be called without the need of the stream name and the dot.
)
0 Очень часто приходится читать с $(C stdin) и записывать в $(C stdout), поэтому сделано так что для этих действий можно не писать имя потока и точку.
)
→$(P
Operations on these streams normally require the name of the stream, a dot, and the operation; as in $(C stream.operation()).
0 $(P
Обычно, чтобы выполнить какое-либо действие над этими потоками нужно указать имя потока, затем точку, а после нее действие; вот так $(C поток.действие()).
→$(P
$(IX stdin) $(IX stdout) The names of the standard input and output streams in D are $(C stdin) and $(C stdout), respectively.
)
0 $(P
$(IX stdin) $(IX stdout) В D, стандартный поток ввода называется $(C stdin), а поток вывода $(C stdout).
)
→As D's standard input and standard output fit this description, they are character streams.
)
0 Стандартные потоки ввода и вывода в D подходят под такое определение, они - потоки знаков.
)
→$(P
This concept of consecutive characters is called a $(I character stream).
0 $(P
Такая последовательность знаков называется $(I поток знаков) $(I (character stream)).
→$(P
These conversions happen automatically.
)
0 $(P
Эти преобразования выполняются автоматически.
)
→For example, the integer value 42 actually comes through the standard input as the characters $(C 4) and $(C 2).
)
0 К примеру, число 42 получается со стандартного ввода как два знака $(C 4) и $(C 2).
)
→The information always comes as characters to be converted to data.
0 Данные всегда поступают в виде знаков, и позже преобразуются в нужное представление.
→$(P
Similarly, what we normally perceive as the $(I keyboard) is actually the $(I standard input stream) of a program and is also character based.
0 $(P
$(I Ввод с клавиатуры), в действительности, это $(I стандартный поток ввода) $(I (standard input stream)) программы, и он тоже работает со знаками.
→For example, the integer value 100 that we've printed in the last chapter is not sent to the output as the value 100, but as the three characters $(C 1), $(C 0), and $(C 0).
)
0 К примеру, число 100 что мы печатали в предыдущей главе, отправляется на вывод как три знака $(C 1), $(C 0) и $(C 0), а не просто как значение 100.
)
→$(P
The standard output is character based; everything to be printed is first converted to the corresponding character representation and then sent to the output as characters.
0 $(P
Стандартный вывод работает со знаками - все что будет напечатано, прежде, преобразуется в соответствующее знаковое представление, и затем в виде знаков посылается на вывод.
→The objects that can accept output are called $(I standard output streams).
)
0 Объекты принимающие вывод называются $(I стандартными потоками вывода) $(I (standard output streams)).
)
→Although the terminal is often the ultimate target of output, this is not always the case.
0 Несмотря на то что вывод часто направляется в терминал, все-же это не всегда так.
→$(P
So far, the printed output of our programs has been appearing on the $(I terminal window) (or $(I screen)).
0 $(P
До сих пор вывод наших программ появлялся лишь в $(I окне терминала) (или на $(I экране)).
Резюме
Пол:
существо
Родной язык:
русский
С нами:
с 8 ноября 2017 г. (3264 дня) по приглашению myCrack
Деятельность:
139 версий перевода с общим рейтингом 0
36 комментариев
Написать dlang личное сообщение