Passing value from function to another function

Hi i have these 2 functions..
function1() and function2()
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Funct::function1()
{
    int num;
    cout<<"how many loops?";
    cin>>num;
}
Funct::function2()
{
    int i;
    //now the question is how should I pass the num variable
    //in the first function to the for in the second loop function..
    //I should place the num variable inside the condition...
    for(i=0;i</*num*/;i++)
    {}
}
Last edited on
https://www.youtube.com/watch?v=-87KQS-rZCA&list=PLAE85DE8440AA6B83&index=10&ab_channel=thenewboston

This video should explain it well. If you're still have trouble come feel free to post again :)

Edit: Also, you forgot a parenthesisafter the i++

for(i=0;i</*num*/;i++) // added a )
Last edited on
@TarikNeaj yeah i did notice :D thanks
okay2, ill watch it
Topic archived. No new replies allowed.