What is the maximum number of statements in a main function?

What is the maximum number of operators that the main function or any other function can handle? What is the limit of expression characters?

+4
source share
4 answers

In accordance with a standard document C11, chapter 5.2.4.1, "Restrictions translation" (see "Restrictions on the protection of the environment") there is no constraint is specified on number of statementsa main()or any other function block or broadcast.

You are limited only by your work environment. imagination (operating system, compiler configuration, target platform, etc.).

+5

C ( , ) . , .

GCC, , :

.

. GNU cpp , . . .

, . ( ) .

+1

There are no restrictions for operators, but don’t write all your code basically, it can get ... pretty ugly. :)

0
source

Although there is no specified limit, you cannot write an arbitrarily large procedure. Just keep in mind that this procedure must be compiled into an assembly. These assembly instructions should be placed on the storage device / memory.

0
source

Source: https://habr.com/ru/post/1661076/


All Articles