Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

newbie4life

C++ Questionmentism

This topic is 5809 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was wondering if, in C++, there is a way to link the end of a function to the middle of the same function so that it loops. For example: #include <iostream> #include <string int main() { string blah; cin>> blah; cout << "The word you typed is " << blah << endl; } How would I make it repeat the output over and over again without making it a seperate function? thanx, -Newbie

Share this post


Link to post
Share on other sites
Advertisement
do this:

for( ; ; )
{
cout << "Somebody stop me!" << endl;
}
//------- OR -------
while(true)
{
cout << "Somebody stop me, please!" << endl;
}
//------- OR -------
do
{
cout << "STOP ME!" << endl;
}while(true);


[edited by - DerekSaw on August 26, 2002 2:18:09 AM]

Share this post


Link to post
Share on other sites

  
int main()
{
start:

cout << "dont use goto in programming c++ programs" << endl;

goto start;

return 0;
}

;

Its my duty, to please that booty ! - John Shaft

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!