I
I
Ilya1992019-01-16 14:56:10
C++ / C#
Ilya199, 2019-01-16 14:56:10

Do I understand everything correctly?

include <stdio.h> // include - директива препроцессора/программа, которая копирует содержимое файла stdio.h

int main(void) { // функция main, которая возвращает целочисленное значение. аргументов не принимает
    int x  = 10; // объявление переменной x, которой присваивается значение 10

    return 0; // возврат родительному процессу(операционная система/терминал). 0 - завершение без ошибок
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saboteur, 2019-01-16
@Ilya199

include <stdio.h> // include - директива препроцессора/программа, которая копирует содержимое файла stdio.h

It is possible and so, but it is more correct to "include", that is, inserts.
void means that the type of the arguments is not defined and is optional. They can be transferred, and even you can work with them. It's just that when calling a function, you can pass, you can not transfer without causing an error.
yes, definition with assignment
Yes. In the C standard, a return from the main function automatically calls exit, returning the code to the OS.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question