943,918 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 1199
  • C RSS
Jul 25th, 2006
0

<help> is there a way to...

Expand Post »
is there a way to simply tell the compiler to JUMP back to a different point???

like:
  1. loop;
  2. "stuff"
  3. loop;

the first loop says where the second loop loops back to any help would help thatnks alot

-kbcubs-
Reputation Points: 10
Solved Threads: 0
Light Poster
wingwarp is offline Offline
37 posts
since Jul 2006
Jul 25th, 2006
0

Re: <help> is there a way to...

lookup for the keyword goto

But using goto for looping is very very bad practice. For looping you can use the for, while, do-while keywords. It is much easier to understand and easier to maintain than goto.
Moderator
Reputation Points: 572
Solved Threads: 115
Mentally Challenged Mod.
WolfPack is offline Offline
1,559 posts
since Jun 2005
Jul 25th, 2006
0

Re: <help> is there a way to...

ok thanks wolf pack

-kbcubs-
Reputation Points: 10
Solved Threads: 0
Light Poster
wingwarp is offline Offline
37 posts
since Jul 2006
Jul 25th, 2006
1

Re: <help> is there a way to...

Why couldn't you split your code into seperate methods and execute a certain method when you need it? As Wolf said, goto is bad practice and I consider it old school :cheesy:
Reputation Points: 113
Solved Threads: 19
Postaholic
server_crash is offline Offline
2,108 posts
since Jun 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Extracting folder information
Next Thread in C Forum Timeline: football.cpp





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC