Connecting Tech Pros Worldwide Help | Site Map

void main() is user defind?

  #1  
Old September 28th, 2006, 03:35 PM
dhan
Guest
 
Posts: n/a
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!!!!!!!!!!!!!!!!!!!!!!!!!

  #2  
Old September 28th, 2006, 03:35 PM
Victor Bazarov
Guest
 
Posts: n/a

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


  #3  
Old September 28th, 2006, 03:35 PM
Rolf Magnus
Guest
 
Posts: n/a

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.

  #4  
Old September 28th, 2006, 04:25 PM
Stuart Redmann
Guest
 
Posts: n/a

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
  #5  
Old September 29th, 2006, 03:55 AM
Martin Steen
Guest
 
Posts: n/a

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit answers 0 November 14th, 2005 04:15 AM
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit answers 0 November 13th, 2005 11:37 PM
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit answers 0 November 13th, 2005 09:56 PM
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit answers 0 November 13th, 2005 03:15 AM