answersLogoWhite

0

No, for example it cannot be nested in:

- another function definition

- type-definition

- variable-definition

But, if you mean calling function main, you can do that without limits (not common practice, though).

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

Can you execute a C program without writing main anywhere in the program?

With special linker-options (platform-dependent) you might be able to create a program that has function 'Start' (for example), instead of 'main', but I don't see any reason in it.


How do you write a program that will call a function to multiply 4 numbers and return the answer to main program?

In Windows, use notepad.exe; in linux, use program xedit.


Why you use main function in c?

Because if you donot use main function in c program, the compiler willnot execute the program.C compiler starts execution from main function itself.


Can you use header files on the bottem of the program?

You can use header files (more specifically "include" files) anywhere in a program. You just have to consider what type of statements, declarative or definitive, there are in the include file, and what your effective scope is. That is why they are generally at the top.


Where is the mail merge feature located in the main menu?

It would depend on the program you are trying to use.


Are the variables argc and argv are local to main?

Answeryes they are local to mainAnswerargc and argv can be used as variable names anywhere in a C program. If they are declared as arguments to main() then they are local to main:int main(int argc, char *argv[]){// argc and argv are local to main in this short programreturn 0;}


Can java program can be written without main?

No, main() class is required to execute the program as that's the starting point of the program.


How to write java program without using main method?

Java program without mainWe need a main method for executing a program.But YES we can write a program without using main() method.TRICK 1 of 2 :: while writing applets in java we don't use main... we use init() method instead.TRICK 2 of 2 :: using 'static' we can write a program whic will execute successfully and output the desired message on screen. Here it is :: class Mohit{ static { System.out.println("This java program has run without the main method"); System.exit(0); } } -->save the program as Mohit.java to compile::javac Mohit.java (in command prompt) to run ::java Mohit(command prompt) output will be ::This java program has run without the main methodWhoa!!!!! we are done.;)


What is the dynamic program that can be moved anywhere on the screen?

A graphical user interface application. For example, a Windows program or a Mac program.


The main method of a program has?

The Java main method of a program is the place where the program execution begins. A main method would look like below public static void main(String[] args){ }


Can you use two main in C programme?

No. You can only have one main() function in a C or C++ program.Note:If this question means "Will the OS start two threads/processes if I have two public scope 'main' functions in my program?"then the answer is "No, even if you could link such program, which you cannot."


What statements may appear anywhere you need them in a program?

Any statements may appear anywhere you need them in a program, provided those statements are within the scope of those locations. In modular programming, you must include the module that contains each statement's prototype wherever you intend to use those statements.