User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 391,596 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,650 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser:
Views: 261 | Replies: 8
Reply
Join Date: Apr 2008
Location: PLANET EARTH
Posts: 33
Reputation: Dannyo329 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 2
Dannyo329's Avatar
Dannyo329 Dannyo329 is offline Offline
Light Poster

Subs?

  #1  
May 11th, 2008
Hey Everyone.
Is there any way to make a sub? For example there's int main(), can I make something else like int menu() and sort of link int main to int menu? I have no idea how to do this.
Greetings Earthlings, I am your PROGRAMMER.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2005
Posts: 3,257
Reputation: Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of 
Rep Power: 20
Solved Threads: 368
Colleague
Salem's Avatar
Salem Salem is offline Offline
void main'ers are DOOMed

Re: Subs?

  #2  
May 11th, 2008
The forum is littered with examples, it shouldn't take too long to find something.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
Do not PM me for help; You'll be ignored, or told to learn to read.
Do not ask me if I'm muslim - I'm not. Nor do I care about yours or anyone else's mysticism. Religion is a matrix, take the RED PILL.
Reply With Quote  
Join Date: Apr 2008
Location: PLANET EARTH
Posts: 33
Reputation: Dannyo329 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 2
Dannyo329's Avatar
Dannyo329 Dannyo329 is offline Offline
Light Poster

Re: Subs?

  #3  
May 11th, 2008
There's 50 pages, but I'll try and look throught them....
Greetings Earthlings, I am your PROGRAMMER.
Reply With Quote  
Join Date: Mar 2008
Posts: 138
Reputation: Sky Diploma is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 21
Sky Diploma's Avatar
Sky Diploma Sky Diploma is offline Offline
Junior Poster

Re: Subs?

  #4  
May 11th, 2008
Originally Posted by Dannyo329 View Post
Hey Everyone.
Is there any way to make a sub? For example there's int main(), can I make something else like int menu() and sort of link int main to int menu? I have no idea how to do this.


Well if you wanna make subs as you call them read functions for c++

This link below might help.

http://www.devarticles.com/c/a/Cplus...ons-in-C-plus/
Websitewiz.co.nr
Check out my Old website. Designed it at the age of 12
Reply With Quote  
Join Date: Oct 2006
Location: the Netherlands
Posts: 1,562
Reputation: niek_e is a jewel in the rough niek_e is a jewel in the rough niek_e is a jewel in the rough niek_e is a jewel in the rough 
Rep Power: 8
Solved Threads: 158
niek_e's Avatar
niek_e niek_e is offline Offline
Posting Virtuoso

Re: Subs?

  #5  
May 11th, 2008
I like this tutorial about function better
do NOT pm me for help, it makes me angry. You wouldn't like me when I'm angry...
Reply With Quote  
Join Date: Dec 2005
Posts: 3,257
Reputation: Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of 
Rep Power: 20
Solved Threads: 368
Colleague
Salem's Avatar
Salem Salem is offline Offline
void main'ers are DOOMed

Re: Subs?

  #6  
May 11th, 2008
> There's 50 pages, but I'll try and look throught them....
I'd be surprised if you couldn't find an example on every page.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
Do not PM me for help; You'll be ignored, or told to learn to read.
Do not ask me if I'm muslim - I'm not. Nor do I care about yours or anyone else's mysticism. Religion is a matrix, take the RED PILL.
Reply With Quote  
Join Date: Apr 2008
Location: PLANET EARTH
Posts: 33
Reputation: Dannyo329 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 2
Dannyo329's Avatar
Dannyo329 Dannyo329 is offline Offline
Light Poster

Re: Subs?

  #7  
May 13th, 2008
Thanks, but is there any way to link to a function or something? not just using it for something like: Add() and stuff.
Greetings Earthlings, I am your PROGRAMMER.
Reply With Quote  
Join Date: Oct 2006
Location: the Netherlands
Posts: 1,562
Reputation: niek_e is a jewel in the rough niek_e is a jewel in the rough niek_e is a jewel in the rough niek_e is a jewel in the rough 
Rep Power: 8
Solved Threads: 158
niek_e's Avatar
niek_e niek_e is offline Offline
Posting Virtuoso

Re: Subs?

  #8  
May 13th, 2008
I have no idea what you're asking
do NOT pm me for help, it makes me angry. You wouldn't like me when I'm angry...
Reply With Quote  
Join Date: Jun 2006
Posts: 81
Reputation: Laiq Ahmed is on a distinguished road 
Rep Power: 3
Solved Threads: 8
Laiq Ahmed Laiq Ahmed is offline Offline
Junior Poster in Training

Re: Subs?

  #9  
May 13th, 2008
What I understand from your question is that, you want your int menu() function to be the entry point of your program, in C99 Standard its defined that the int main() and int main (int argc, char* argv[]) OR int main (int argc, char** argv) should be the starting point of any program in C, but few compilers let is configurable you can change the options and able to set the entry point to another function like int menu or so.
hope I get your question correctly.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb C++ Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the C++ Forum

All times are GMT -4. The time now is 11:41 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC