473,387 Members | 2,436 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

goto

hi,
what is the equivalent of C languages' goto statement in python?
best regards
Jul 21 '05 #1
30 4220
In python there is no goto statement. In C I use goto only in one case: to
exit more then one level of blocks (as a matter of fact, I always use goto
EXIT in C, where EXIT is the label of the end of the function).

In python you can mimic this by throwing an exception and catching it.
Exception should "know" the destination label name and the catch statement
should compare this name with its (catch statement) name.
"Hayri ERDENER" <ha**********@gmail.com> wrote in message
news:ma***************************************@pyt hon.org...
hi,
what is the equivalent of C languages' goto statement in python?
best regards
Jul 21 '05 #2
Hayri ERDENER wrote:
what is the equivalent of C languages' goto statement in python?


Steven offered the best reply here, in that he wondered what you
actually need this for. What usage of "goto" in C are you hoping to
emulate? It's a certainty that some other non-goto technique will be
more appropriate in Python.

-Peter
Jul 21 '05 #3

Hayri ERDENER schrieb:
hi,
what is the equivalent of C languages' goto statement in python?
best regards


No, but some of goto's use cases can be covered by unconditional jumps
provided by exceptions.
Here is a C function using goto:

void main()
{
int i, j;

for ( i = 0; i < 10; i++ )
{
printf( "Outer loop executing. i = %d\n", i );
for ( j = 0; j < 2; j++ )
{
printf( " Inner loop executing. j = %d\n", j );
if ( i == 3 )
goto stop;
}
}
/* This message does not print: */
printf( "Loop exited. i = %d\n", i );
stop: printf( "Jumped to stop. i = %d\n", i );
}
And here is a Python equivalent using exception handling:

def main():
class stop(Exception):pass
try:
for i in range(10):
print "Outer loop executing. i = %d"%i
for j in range(2):
print " Inner loop executing. j = %d"%j
if i == 3:
raise stop
print "Loop exited. i = %d"%i # message does not print
except stop:
print "Jumped to stop. i = %d"%i
Regards,
Kay

Jul 21 '05 #4
On Mon, Jul 18, 2005 at 08:40:16AM -0700, Kay Schluehr wrote:
Hayri ERDENER schrieb:
hi,
what is the equivalent of C languages' goto statement in python?
best regards


No, but some of goto's use cases can be covered by unconditional jumps
provided by exceptions. [...]


I like the "named loops" concept of other HLL like Ada 95 or Java better
than either goto or exceptions. It allows you to use "break" and
"continue" for other than the innermost loops, too:

break; => break out of inner loop
break loop_name; => break out of named loop "loop_name"

OTOH it's not used *that* often, so I won't argue for including it in
Python ;)

-- Gerhard
--
Gerhard Häring - gh@ghaering.de - Python, web & database development

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFC29EEdIO4ozGCH14RAvXeAKC5p8zGuOeI6OcsRNaS5n q+k9/ZyQCgtA2n
ngCyiXRD5Z8PIauStFNBwKg=
=+91Q
-----END PGP SIGNATURE-----

Jul 21 '05 #5
On Mon, 18 Jul 2005 14:48:08 +0300, Hayri ERDENER
<ha**********@gmail.com> declaimed the following in comp.lang.python:
hi,
what is the equivalent of C languages' goto statement in python?
best regards
A Google search on "Python comefrom" has a few hits...

-- ================================================== ============ <
wl*****@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
================================================== ============ <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.netcom.com/> <

Jul 21 '05 #6
Hayri ERDENER wrote:
what is the equivalent of C languages' goto statement in python?


Download the goto module:
http://www.entrian.com/goto/
And you can use goto to your heart's content. And to the horror of all
your friends/coworkers. ;)

STeVe
Jul 21 '05 #7
rbt
On Mon, 2005-07-18 at 12:27 -0600, Steven Bethard wrote:
Hayri ERDENER wrote:
what is the equivalent of C languages' goto statement in python?


Download the goto module:
http://www.entrian.com/goto/
And you can use goto to your heart's content. And to the horror of all
your friends/coworkers. ;)

STeVe


Shouldn't that be "to the horror of all your goto-snob friends."

IMO, most of the people who deride goto do so because they heard or read
where someone else did.

Many of the world's most profitable software companies (MS for example)
have thousands of goto statements in their code... oh the horror of it
all. Why aren't these enlightened-by-the-gods know-it-alls as profitable
as these obviously ignorant companies?

Jul 21 '05 #8
rbt wrote:
On Mon, 2005-07-18 at 12:27 -0600, Steven Bethard wrote:
Hayri ERDENER wrote:
what is the equivalent of C languages' goto statement in python?


Download the goto module:
http://www.entrian.com/goto/
And you can use goto to your heart's content. And to the horror of all
your friends/coworkers. ;)


Shouldn't that be "to the horror of all your goto-snob friends."

IMO, most of the people who deride goto do so because they heard or read
where someone else did.


Or because they've seen some BASIC programs written ca. 1980.

Jul 21 '05 #9
rbt wrote:
Steven Bethard wrote:
Download the goto module:
http://www.entrian.com/goto/
And you can use goto to your heart's content. And to the horror of all
your friends/coworkers. ;)


Shouldn't that be "to the horror of all your goto-snob friends."

IMO, most of the people who deride goto do so because they heard or read
where someone else did.

Many of the world's most profitable software companies (MS for example)
have thousands of goto statements in their code... oh the horror of it
all. Why aren't these enlightened-by-the-gods know-it-alls as profitable
as these obviously ignorant companies?


Perhaps I should reiterate: ;) Oh, and ;)

The CPython source code is filled with gotos -- with a rough grep count,
I found over 2000. And, while I wouldn't care to inspect them all, I'd
guess that they're mostly quite appropriate. A lot of them look like
"goto fail", "goto finally", etc. and are used to handle error
conditions. Heck, the patch I wrote to add key= arguments to min() and
max() in Python 2.5 uses goto for exactly this purpose.

That said, I don't think my joke was really that inaccurate -- I have
yet to see a good use case for gotos in Python. Why use gotos when you
have an efficient exception handling mechanism?

STeVe
Jul 21 '05 #10
On Mon, 18 Jul 2005 16:37:57 -0400, rbt wrote:
Shouldn't that be "to the horror of all your goto-snob friends."

IMO, most of the people who deride goto do so because they heard or read
where someone else did.
Or because they actually programmed in languages that used goto for flow
control. Some of us have even programmed in versions of BASIC that didn't
have FOR or WHILE loops, you had to roll your own out of gotos.

How about you? How many times have you had to maintain and debug spaghetti
code sprinkled with gotos all over the place?
Many of the world's most profitable software companies (MS for example)
have thousands of goto statements in their code... oh the horror of it
all. Why aren't these enlightened-by-the-gods know-it-alls as profitable
as these obviously ignorant companies?


You know, I agree with you here. Why, just the other day I was discussing
computer systems with my Aunt Tilly, who wanted to buy a computer so she
could send emails to her friends and relatives. I suggested she buy a Mac,
and she said "Well, I thought about buying a Mac, but I'm afraid I can't
possibly use any software that wasn't written using goto. So I'm going to
buy a Windows machine. Do you recommend any anti-virus and anti-spyware
software that's easy to use?"
--
Steven.

Jul 21 '05 #11
rbt <rb*@athop1.ath.vt.edu> writes:
Many of the world's most profitable software companies (MS for example)
have thousands of goto statements in their code... oh the horror of it
all. Why aren't these enlightened-by-the-gods know-it-alls as profitable
as these obviously ignorant companies?


Because profitability has *nothing* to do with code quality, and
everything to do with marketing. MS, in particular, has done an
excellent job of divorcing code quality from their bottom line by
shuffling the bulk of the support work off to other companies:
hardware vendors who bundle MS software, system integrators, and
customers friends and family being very high on the list.

That they felt the need to do this speaks volumes about their code
quality.

<mike
--
Mike Meyer <mw*@mired.org> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
Jul 21 '05 #12
Steven Bethard wrote:
Hayri ERDENER wrote:
what is the equivalent of C languages' goto statement in python?


Download the goto module:
http://www.entrian.com/goto/
And you can use goto to your heart's content. And to the horror of all
your friends/coworkers. ;)

STeVe


That is actually a _really_ cool piece of code, in terms of showing off the
kind of things which are possible in python if you're willing to be a little
sneaky.

Thanks for the pointer !

best

f

Jul 21 '05 #13
D H
Mike Meyer wrote:
rbt <rb*@athop1.ath.vt.edu> writes:
Many of the world's most profitable software companies (MS for example)
have thousands of goto statements in their code... oh the horror of it
all. Why aren't these enlightened-by-the-gods know-it-alls as profitable
as these obviously ignorant companies?

Because profitability has *nothing* to do with code quality, and
everything to do with marketing. MS, in particular, has done an
excellent job of divorcing code quality from their bottom line by
shuffling the bulk of the support work off to other companies:
hardware vendors who bundle MS software, system integrators, and
customers friends and family being very high on the list.

That they felt the need to do this speaks volumes about their code
quality.


whoa whoa whoa! Discussing goto statements and Microsoft together is
like mixing dynamite and gasoline. We don't want this to explode into
some interminable argument; that's not the kind of thing people like to
see on comp.lang.python.

Oh by the way, boo has goto statements:
http://svn.boo.codehaus.org/trunk/te....boo?view=auto

KABOOM
Jul 21 '05 #14
rbt wrote:
IMO, most of the people who deride goto do so because they heard or read
where someone else did.


1 GOTO 17
2 mean, GOTO 5
3 could GOTO 6
4 with GOTO 7
5 what GOTO 3
6 possibly GOTO 24
7 you! GOTO 21
8 that GOTO 18
9 really, GOTO 23
10 understandable?
11 neat. GOTO 16
12 and GOTO 25
13 are GOTO 9
14 I GOTO 26
15 wrong GOTO 20
16 I GOTO 2
17 Yes, GOTO 14
18 simple GOTO 12
19 agree GOTO 4
20 with GOTO 22
21 Gotos GOTO 13
22 something GOTO 8
23 really GOTO 11
24 be GOTO 15
25 easily GOTO 10
26 totally GOTO 19
Jul 21 '05 #15
rbt
10 PRINT "YOU'RE NOT RIGHT IN THE HEAD."
20 GOTO 10
On Tue, 2005-07-19 at 02:33 +0000, Leif K-Brooks wrote:
rbt wrote:
IMO, most of the people who deride goto do so because they heard or read
where someone else did.


1 GOTO 17
2 mean, GOTO 5
3 could GOTO 6
4 with GOTO 7
5 what GOTO 3
6 possibly GOTO 24
7 you! GOTO 21
8 that GOTO 18
9 really, GOTO 23
10 understandable?
11 neat. GOTO 16
12 and GOTO 25
13 are GOTO 9
14 I GOTO 26
15 wrong GOTO 20
16 I GOTO 2
17 Yes, GOTO 14
18 simple GOTO 12
19 agree GOTO 4
20 with GOTO 22
21 Gotos GOTO 13
22 something GOTO 8
23 really GOTO 11
24 be GOTO 15
25 easily GOTO 10
26 totally GOTO 19


Jul 21 '05 #16
Fernando Perez wrote:
Steven Bethard wrote:
Download the goto module:
http://www.entrian.com/goto/
And you can use goto to your heart's content. And to the horror of all
your friends/coworkers. ;)


That is actually a _really_ cool piece of code, in terms of showing off the
kind of things which are possible in python if you're willing to be a little
sneaky.


Yeah, it's pretty slick. I think most people who see the link don't
realize that it's actually *working code* for gotos in Python.

STeVe
Jul 21 '05 #17
rbt enlightened us with:
Many of the world's most profitable software companies (MS for
example) have thousands of goto statements in their code... oh the
horror of it all. Why aren't these enlightened-by-the-gods
know-it-alls as profitable as these obviously ignorant companies?


They write software with huge security holes. Direct3D still isn't as
stable as OpenGL. It takes ages for them to create security patches.

The things I mention are *not* caused by their nice and clean way of
coding.

As a matter of fact, they use goto to jump from one function to
another! And to make sure a 'return' doesn't return to the last call,
but to some other, they combine this awful use of goto with manual
stack manipulation. And they do all of this in C (or some derivative)
so if one function changes it's parameters, all the manual stack
modifications and gotos need to be checked for correctness.

I'd rather use an exception, or better even - write small functions so
I can call 'return' instead of doing 'goto EXIT'.

Sybren
--
The problem with the world is stupidity. Not saying there should be a
capital punishment for stupidity, but why don't we just take the
safety labels off of everything and let the problem solve itself?
Frank Zappa
Jul 21 '05 #18
rbt wrote:
IMO, most of the people who deride goto do so because they heard or read
where someone else did.


Or perhaps, like me, they have had to maintain FORTRAN code written by a
scientist who apparently hadn't heard of subroutines. "Spaghetti"
doesn't quite describe it. I've settled on "Lovecraftian": reading the
code, you can't help but get the impression of writhing tentacles and
impossible angles.

--
Robert Kern
rk***@ucsd.edu

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter

Jul 21 '05 #19
On Tue, 19 Jul 2005 02:33:02 +0000, Leif K-Brooks wrote:
rbt wrote:
IMO, most of the people who deride goto do so because they heard or read
where someone else did.


1 GOTO 17
2 mean, GOTO 5
3 could GOTO 6


[snip]

That's great, but not a patch on the power of COMEFROM!

Or, to put it another way:

1
2 readability COMEFROM 4
3 that's COMEFROM 6
4 hurt COMEFROM 7
5 to COMEFROM 10
6 but COMEFROM 2
7 might COMEFROM 9
8 nothing COMEFROM 3
9 goto COMEFROM 12
10 compared COMEFROM 8
11 comefrom COMEFROM 5
12 using COMEFROM 1
--
Steven.

Jul 21 '05 #20
Leif K-Brooks wrote:
rbt wrote:
IMO, most of the people who deride goto do so because they heard or read
where someone else did.

1 GOTO 17
2 mean, GOTO 5
3 could GOTO 6
4 with GOTO 7
5 what GOTO 3
6 possibly GOTO 24
7 you! GOTO 21
8 that GOTO 18
9 really, GOTO 23
10 understandable?
11 neat. GOTO 16
12 and GOTO 25
13 are GOTO 9
14 I GOTO 26
15 wrong GOTO 20
16 I GOTO 2
17 Yes, GOTO 14
18 simple GOTO 12
19 agree GOTO 4
20 with GOTO 22
21 Gotos GOTO 13
22 something GOTO 8
23 really GOTO 11
24 be GOTO 15
25 easily GOTO 10
26 totally GOTO 19


I dislike gotos because it is too easy to inadvertently create infinite
loops. <10 WINK; 20 GOTO 10>
Jul 21 '05 #21
"rbt" <rb*@athop1.ath.vt.edu> wrote:
On Mon, 2005-07-18 at 12:27 -0600, Steven Bethard wrote:
Hayri ERDENER wrote:
what is the equivalent of C languages' goto statement in python?


Download the goto module:
http://www.entrian.com/goto/
And you can use goto to your heart's content. And to the horror of all
your friends/coworkers. ;)

STeVe


Shouldn't that be "to the horror of all your goto-snob friends."

IMO, most of the people who deride goto do so because they heard or read
where someone else did.

Many of the world's most profitable software companies (MS for example)
have thousands of goto statements in their code... oh the horror of it
all. Why aren't these enlightened-by-the-gods know-it-alls as profitable
as these obviously ignorant companies?

It should not really come as a shock that the same fellow who came up with a brilliant efficient way
to generate all permutations (http://tinyurl.com/dnazs) is also in favor of goto.

Coming next from rbt: "Pointer arithmetic in python ?".

George
Jul 21 '05 #22
rbt
On Tue, 2005-07-19 at 10:02 -0400, George Sakkis wrote:
"rbt" <rb*@athop1.ath.vt.edu> wrote:
On Mon, 2005-07-18 at 12:27 -0600, Steven Bethard wrote:
Hayri ERDENER wrote:
> what is the equivalent of C languages' goto statement in python?

Download the goto module:
http://www.entrian.com/goto/
And you can use goto to your heart's content. And to the horror of all
your friends/coworkers. ;)

STeVe


Shouldn't that be "to the horror of all your goto-snob friends."

IMO, most of the people who deride goto do so because they heard or read
where someone else did.

Many of the world's most profitable software companies (MS for example)
have thousands of goto statements in their code... oh the horror of it
all. Why aren't these enlightened-by-the-gods know-it-alls as profitable
as these obviously ignorant companies?

It should not really come as a shock that the same fellow who came up with a brilliant efficient way
to generate all permutations (http://tinyurl.com/dnazs) is also in favor of goto.

Coming next from rbt: "Pointer arithmetic in python ?".

George


I have moments of brilliance and moments of ignorance. You must admit
though, that was a unique way of generating permutations... how many
other people would have thought of that approach? It did solve my
problem ;)

Jul 21 '05 #23
On Tue, 19 Jul 2005 11:29:58 -0400, rbt wrote:
It should not really come as a shock that the same fellow who came up with a brilliant efficient way
to generate all permutations (http://tinyurl.com/dnazs) is also in favor of goto.

Coming next from rbt: "Pointer arithmetic in python ?".

George


I have moments of brilliance and moments of ignorance. You must admit
though, that was a unique way of generating permutations... how many
other people would have thought of that approach? It did solve my
problem ;)


Sorry rbt, but your algorithm isn't unique, nor was it clever, and in fact
your implementation wasn't very good even by the undemanding requirements
of the algorithm. It is just a minor modification of bogosort (also known
as "bozo-sort") algorithm:

http://en.wikipedia.org/wiki/Bogosort

I quote:

"...bogosort is 'the archetypal perversely awful algorithm', one example
of which is attempting to sort a deck of cards by repeatedly throwing the
deck in the air, picking the cards up at random, and then testing whether
the cards are in sorted order."

Bogosort is nothing to be proud of, except as a joke. Put it this way: of
all the many ways to generate a list of permutations, you managed to find
perhaps the least efficient algorithm possible.

This is especially ironic when you think back to your first question,
which was how to generate the combinations most efficiently.
--
Steven.

Jul 21 '05 #24
rbt
On Wed, 2005-07-20 at 03:43 +1000, Steven D'Aprano wrote:
On Tue, 19 Jul 2005 11:29:58 -0400, rbt wrote:
It should not really come as a shock that the same fellow who came up with a brilliant efficient way
to generate all permutations (http://tinyurl.com/dnazs) is also in favor of goto.

Coming next from rbt: "Pointer arithmetic in python ?".

George


I have moments of brilliance and moments of ignorance. You must admit
though, that was a unique way of generating permutations... how many
other people would have thought of that approach? It did solve my
problem ;)


Sorry rbt, but your algorithm isn't unique, nor was it clever, and in fact
your implementation wasn't very good even by the undemanding requirements
of the algorithm. It is just a minor modification of bogosort (also known
as "bozo-sort") algorithm:

http://en.wikipedia.org/wiki/Bogosort

I quote:

"...bogosort is 'the archetypal perversely awful algorithm', one example
of which is attempting to sort a deck of cards by repeatedly throwing the
deck in the air, picking the cards up at random, and then testing whether
the cards are in sorted order."

Bogosort is nothing to be proud of, except as a joke.


It *was* a joke.

Jul 21 '05 #25
Steven Bethard wrote:
Fernando Perez wrote:
Steven Bethard wrote:
Download the goto module:
http://www.entrian.com/goto/
And you can use goto to your heart's content. And to the horror of all
your friends/coworkers. ;)


That is actually a _really_ cool piece of code, in terms of showing off the
kind of things which are possible in python if you're willing to be a little
sneaky.


Yeah, it's pretty slick. I think most people who see the link don't
realize that it's actually *working code* for gotos in Python.


For a second I didn't think it was, but the page looked too serious to be just
a mockup (regardless of the April's fool warning at the top). So I actually
donwloaded the code to see how he did it, because it wasn't quite obvious to
me after the standard 3 seconds of thought. It was quite fun the read how he
got it to work.

Cheers,

f

Jul 21 '05 #26
Rocco Moretti <ro**********@hotpop.com> writes:
Leif K-Brooks wrote:
rbt wrote:
IMO, most of the people who deride goto do so because they heard or read
where someone else did.

1 GOTO 17
2 mean, GOTO 5
3 could GOTO 6
4 with GOTO 7
5 what GOTO 3
6 possibly GOTO 24
7 you! GOTO 21
8 that GOTO 18
9 really, GOTO 23
10 understandable?
11 neat. GOTO 16
12 and GOTO 25
13 are GOTO 9
14 I GOTO 26
15 wrong GOTO 20
16 I GOTO 2
17 Yes, GOTO 14
18 simple GOTO 12
19 agree GOTO 4
20 with GOTO 22
21 Gotos GOTO 13
22 something GOTO 8
23 really GOTO 11
24 be GOTO 15
25 easily GOTO 10
26 totally GOTO 19


I dislike gotos because it is too easy to inadvertently create
infinite loops. <10 WINK; 20 GOTO 10>


And it's impossible without them? <while True: pass>

<mike
--
Mike Meyer <mw*@mired.org> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
Jul 21 '05 #27
Mike Meyer enlightened us with:
I dislike gotos because it is too easy to inadvertently create
infinite loops. <10 WINK; 20 GOTO 10>


And it's impossible without them? <while True: pass>


I thought the same thing, but then I read it again and thought about
the "inadvertently". As soon as you see a "while True", you _know_
it's going to loop forever. As soon as you see a "goto 10", you don't.

Sybren
--
The problem with the world is stupidity. Not saying there should be a
capital punishment for stupidity, but why don't we just take the
safety labels off of everything and let the problem solve itself?
Frank Zappa
Jul 21 '05 #28
Sybren Stuvel wrote:
Mike Meyer enlightened us with:
I dislike gotos because it is too easy to inadvertently create
infinite loops. <10 WINK; 20 GOTO 10>


And it's impossible without them? <while True: pass>

I thought the same thing, but then I read it again and thought about
the "inadvertently". As soon as you see a "while True", you _know_
it's going to loop forever.


Unless it doesn't, of course:

while True:
break
Jul 21 '05 #29
My "favorite" infinte loop with while is:

i = 0
while i < 20:
do_process(i)

Note the prominent *lack* of any change to i here?

Oh, for:

from i = 0
invariant 0 <= i <= 20
variant 21 - i
until i > 19
loop
do_process(i)

which throws an exception at the beginning of the second loop.


What language is that from?

I take it the exception is from the "21-i" not changing as it goes
around the loop, right? (But why can't "variant i" work just as well?)
Jul 21 '05 #30
Rocco Moretti <ro**********@hotpop.com> writes:
My "favorite" infinte loop with while is:
i = 0
while i < 20:
do_process(i)
Note the prominent *lack* of any change to i here?
Oh, for:
from i = 0
invariant 0 <= i <= 20
variant 21 - i
until i > 19
loop
do_process(i)
which throws an exception at the beginning of the second loop.
What language is that from?


Eiffel.
I take it the exception is from the "21-i" not changing as it goes
around the loop, right? (But why can't "variant i" work just as well?)


Because that's the way variant is defined. You actually want the
variant to move in a specific direction, so that you don't wind up
incrementing it when you should be decrementing it. Eiffel chose down,
so you you need -i at the very least. It also insists that the
invariant be positive. I'm not sure why; it makes the variant more
complicated, resulting in exceptions from bugs in the variant as well
as bugs in the loop.

<mike
--
Mike Meyer <mw*@mired.org> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
Jul 22 '05 #31

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

51
by: WindAndWaves | last post by:
Can anyone tell me what is wrong with the goto command. I noticed it is one of those NEVER USE. I can understand that it may lead to confusing code, but I often use it like this: is this...
37
by: Tim Marshall | last post by:
From http://www.mvps.org/access/tencommandments.htm 9th item: Thou shalt not use "SendKeys", "Smart Codes" or "GoTo" (unless the GoTo be part of an OnError process) for these will lead you...
52
by: Rick | last post by:
Hi, For portability, can an issue arise if we use while(1) for an infinite loop in C? If so, should we then use for(;;)? Thanks, Rick
45
by: Debashish Chakravarty | last post by:
K&R pg.66 describes two situations when using goto makes sense. Has anyone here come across situations where using goto provided the most elegant solution. --...
77
by: M.B | last post by:
Guys, Need some of your opinion on an oft beaten track We have an option of using "goto" in C language, but most testbooks (even K&R) advice against use of it. My personal experience was that...
34
by: electrician | last post by:
Perl has it, Basic has it, Fortran has it. What is so difficult about creating a goto command for JavaScript. Just set up a label and say go to it.
3
by: electrician | last post by:
Yes, no GOTO. This is a major blunder on part of the creators of these tools. GOTO gives the programmer the absolute control over the program. Yes, no matter what, a GOTO sends the program to...
17
by: SoftEast | last post by:
Hi Buddies, I have read a lot of stuffs regarding not using GOTO statements to opt a good programming style http://david.tribble.com/text/goto.html]. Can anybody give a particular lines of code...
59
by: raashid bhatt | last post by:
why are GOTO's not used they just a simple JMP instructions what's bad about them
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.