I know I deserve to be shot for even mentioning this but is it possible to have a label in one source file in a project and jump to it from another source file?
also in a concole window, is the a command that will close the window?
I know I deserve to be shot for even mentioning this but is it possible to have a label in one source file in a project and jump to it from another source file?
also in a concole window, is the a command that will close the window?
Well, I dunno about the goto thing but to close the window (I guess you mean quit the program) you can either:Originally posted by unanimous
I know I deserve to be shot for even mentioning this but is it possible to have a label in one source file in a project and jump to it from another source file?
also in a concole window, is the a command that will close the window?
[1] Call exit()
[2] Type return 0; in the main() function.
-Save the whales. Collect the whole set.
> is it possible to have a label in one source file in a project and jump to it from another source file?
No.
If you really need to, use setjmp() and longjmp()
Same disclaimers about abuse of these are the same as for goto, but more so.
How do I use setjmp() or longjmp() to goto a label in another source file? And, how do I Call Exit?
Just about ANYWHERE. Put in at least a little more effort than "Point me in the right direction, give me a sharp push, and make my feet walk right".
-Prelude
My best code is written with the delete key.
I noticed u have MVC++ 6 this means you also have msdn, look at that. You have Dev C++ 4 also, when you compile programs with that the console quits automaticaly once main ends, this is also true with msvc++ 6 if your running in debug mode. Oh and the thing about goto, try it, if it works it works, if it doesn't it doesn't. Still never use goto, praticularly jumping from one function to another, although it seems usefull it will make your code really hard to follow.
>Still never use goto, praticularly jumping from one function to another
This can't be done anyway, goto is restricted to the function that the label is defined in. Despite what some people think, goto is not a nightmarish construct that lets you go anywhere in the program without restriction.
-Prelude
My best code is written with the delete key.
>>Despite what some people think, goto is not a nightmarish construct that lets you go anywhere in the program without restriction.
AHHH, Music to my ears, atlast there is somebody else who thinks the way i do about GOTO
-
yes, nightmarish constructs are uninitialized pointers and other programmer follies... goto has defined behavior, which is A-okay...
hasafraggin shizigishin oppashigger...