Entry Point
Lesson
As you might have noticed in the last chapter, in C++, there are other things other than the print instruction.
In Python, we can just write the code directly.
However, in other languages, there is an “entry point”.
This is where the program starts.
Each program has an entry point.
In C, C++, C# and Java, it is the main() or Main() function.
It means that even if you put code before the main() function, it will not be called first.
Examples
In Python:
# entry point here
In C or C++:
int main()
{
// entry point here
}
In Java:
class Main
{
public static void main(String args[])
{
// entry point here
}
}
In C#:
class YouCanPutAnythingHere
{
static void Main(string[] args)
{
// entry point here
}
}