answersLogoWhite

0


Best Answer

1. In C language, you cannot compile a source-file if it has two (or more) functions with the same name.

2. You cannot link a program if it has two (or more) global (ie: non-static) functions with the same name.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

i think it depends upown the programmer.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

One.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How many main functions can a c plus plus program have?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How many main functions are used in c plus plus program?

One.


In C plus plus what are functions called in reference to the main program?

The main program is itself just a function. Its only purpose is to serve as the entry point of the application. All other functions, whether built-in or user-defined, are just ordinary functions that can be called at any time so long as they are within the scope of the caller.


In c plus plus are local declarations visible to the function in a program?

If you declare a variable inside of any fuction (except main) it will not be available to other functions.


What is the only function all C plus plus programs must contain?

Every C plus plus program that is a main program must have the function 'main'.


What is the importance of functions in a c plus plus program?

Functions are very important in C++, as you can't write the simplest program to print hello without using a function. Overall you can say that function are building blocks of a C++ program. Functions can also be defined by the programmer to reduce program size.


Can a function be called from more than one place in a program in c plus plus?

In C and C++, as well as in many (all?) languages, a function can be called from more than one place in a program. That's the purpose of functions - to encapsulate pieces of code that are needed in more than one place in the program.


How do you link a C plus plus program to C functions?

It should work without any special action.


What is a main function in c plus plus?

It is the first function that gets called when the program is executed.


What are the advantages of having program in a class in C plus plus?

You don't write programs in a class in C++, you write programs that use classes. Every C++ has at least one function, main, the entry point of the application. You define the classes and functions that are used by your main function. Classes allow you to classify the objects used by your program, allowing data to be manipulated in a highly controlled manner, ensuring consistency and robustness throughout your program.


C plus plus program that will count?

#include int main (void) { puts ("1 2 3"); }


How do you write a programm in c plus plus without using function main?

I don't think its possible. Every C++ program must at least have the main function.


What is a primary function in C plus plus?

There is no such thing. You probably meant the main function. The main function is the only function that is required as it serves as the entry point of the program.