How to do GOSUB with goto in C++
Juz wondering, if anyone knows of a simple way to do a GOSUB routine easily in C++
Can''t really think of a simple way..
..
May 02, 2000 04:41 AM
GOSUB stands for Go to Subroutine
in basic, you couldn''t make your own functions, so you had to just start some code at line say 1000
then you''d call GOSUB 1000..
In C, you can create your own functions like this:
FunctionName(, , ...)
so for example:
int Multiply(int v1, int v2)
{
return v1+v2;
}
in basic, you couldn''t make your own functions, so you had to just start some code at line say 1000
then you''d call GOSUB 1000..
In C, you can create your own functions like this:
FunctionName(, , ...)
so for example:
int Multiply(int v1, int v2)
{
return v1+v2;
}
Wow! Been a long time since QBASIC!
If I''m not mistaken, BASIC does allow you to create functions and subroutines. Subroutines are really just functions that don''t return a value, so just use void as the return type:
void MySubroutine()
{
}
- null_pointer
Sabre Multimedia
If I''m not mistaken, BASIC does allow you to create functions and subroutines. Subroutines are really just functions that don''t return a value, so just use void as the return type:
void MySubroutine()
{
}
- null_pointer
Sabre Multimedia
In early BASIC (those GW-BASIC/BASICA time), they really don''t have subroutine. So they had this GOSUB/RETURN things.
As things got more advanced, functions/subroutines starts to appear in BASIC... and for compatibility sake, GOSUB/RETURN still stay (and decaying...)
IMHO, who needs GOSUB in C++ anyway?
As things got more advanced, functions/subroutines starts to appear in BASIC... and for compatibility sake, GOSUB/RETURN still stay (and decaying...)
IMHO, who needs GOSUB in C++ anyway?
"after many years of singularity, i'm still searching on the event horizon"
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement