I have been learning to program at school using the pascal language in programming... I was just wondering if there was an equivilent to the procedures script used in Pascal for C++. thanks
(Demonstrate if possible!)
I have been learning to program at school using the pascal language in programming... I was just wondering if there was an equivilent to the procedures script used in Pascal for C++. thanks
(Demonstrate if possible!)
I don't know Pascal. What does script do?
i don't know if this is what you mean, and i've forgotten almost all of pascal, but:
pascal:
would be the same as:Code:procedure Name1 // creates procedure 1 begin <<code>> // procedure 1 code end; procedure Name2 // creates procedure 2 begin <<code>> // procedure 2 code end; procedure Name1; // executes procedure 1 procedure Name2; // executes procedure 2 end.
C++:
Code:void Function1(); // 'creates' function 1 void Function2(); // 'creates' function 2 int main(void) { Function1(); // executes function 1 Function2(); // executes function 2 } void Function1() { <<code>> // function 1 code } void Function2() { <<code>> // function 2 code }
I believe ChrisE is correct
except his main should return 0;
int main()
{
function1();
function2();
return 0;
}
was just wondering if there was an equivilent to the procedures script used in Pascal for C++. thanks
What are scripts?? Be careful with what you say. I would call it a procedure syntax or declarations- not scripts.
That is a web person!!!
woops, sorry, was in a rush etc