Connecting Tech Pros Worldwide Forums | Help | Site Map

void main() is user defind?

dhan
Guest
 
Posts: n/a
#1: Sep 28 '06
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!!!!!!!!!!!!!!!!!!!!!!!!!


Victor Bazarov
Guest
 
Posts: n/a
#2: Sep 28 '06

re: void main() is user defind?


dhan wrote:
Quote:
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[s]?

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


Rolf Magnus
Guest
 
Posts: n/a
#3: Sep 28 '06

re: void main() is user defind?


dhan wrote:
Quote:
all the programer know the void main is user defind function so,
void main is illegal in C++. main must always return int.
Quote:
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.
Quote:
what can change the "main" word in the c? why?
Not sure what you mean by this.

Stuart Redmann
Guest
 
Posts: n/a
#4: Sep 28 '06

re: void main() is user defind?


Rolf Magnus wrote:
Quote:
Quote:
>>what can change the "main" word in the c? why?
>
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
Martin Steen
Guest
 
Posts: n/a
#5: Sep 29 '06

re: void main() is user defind?


dhan wrote:
Quote:
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
Closed Thread