void main() is user defind?

D

dhan

all the programer know the void main is user defind function so,change
the main is possible or not
and why? what can change the "main" word in the c? why?
please give the answer.....................

bye!!!!!!!!!!!!!!!!!!!!!!!!!
 
R

Rolf Magnus

dhan said:
all the programer know the void main is user defind function so,

void main is illegal in C++. main must always return int.
change the main is possible or not and why?

There are two different signatures for main that the standard covers. Those
are:

int main()

and

int main(int argc, char* argv[])

The compiler might support more variants, but they all must return int.
what can change the "main" word in the c? why?

Not sure what you mean by this.
 
V

Victor Bazarov

dhan said:
all the programer know the void main is user defind function so,change
the main is possible or not
and why? what can change the "main" word in the c? why?
please give the answer.....................

If you need to know about the C language, please follow the hallway
two doors down to comp.lang.c. If you didn't know that C and C++ are
two different languages, you might want to re-read the introduction
part to your textbook.

_In C++_, there is no "void main". In C++ 'main' function (and *all
programmers know that*) returns 'int'. That is required by the C++
language International Standard. Does that answer your question?

V
 
S

Stuart Redmann

Rolf said:
Not sure what you mean by this.

I guess he means that you can change the name of the function that
serves as an executables entry point for some compilers. Furthermore
some compilers require a different signature for the executables entry
point (like WinMain under MS Windows). Since this is platform-specific
it is off-topic here.

Stuart
 
M

Martin Steen

dhan said:
all the programer know the void main is user defind function so,change
the main is possible or not
and why? what can change the "main" word in the c? why?
please give the answer.....................

bye!!!!!!!!!!!!!!!!!!!!!!!!!

You can change "main" if you open the startup-code
with a hex-editor, search for "_main" and change the
string to "_mxxx" or whatever you want.

Or, if you have the assembler-source of the
starup-code, you can change it there.

But this is rather useless. No need to do it.

-Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top