Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old September 28th, 2006, 03:35 PM
dhan
Guest
 
Posts: n/a
Default void main() is user defind?

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
Default 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
Default 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
Default 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
Default 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
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles