| View previous topic :: View next topic |
| Author |
Message |
paupav Master Cheater
Reputation: 13
Joined: 15 Apr 2011 Posts: 314 Location: P. Sherman 42, Wallaby Way, Sydney
|
Posted: Fri Aug 10, 2012 1:17 pm Post subject: so what does return (r); |
|
|
do
| Code: | #include "stdafx.h"
#include <iostream>
using namespace std;
int divide (int a, int b=2)
{
int r;
r=a/b;
return (r);
}
int main ()
{
cout << divide (524);
system("pause");
return 0;
} |
|
|
| Back to top |
|
 |
Fafaffy Cheater
Reputation: 65
Joined: 12 Dec 2007 Posts: 28
|
Posted: Fri Aug 10, 2012 1:18 pm Post subject: |
|
|
it returns the value of r. That way in some other part of your code you can do:
| Code: |
cout << divide(6,2) << endl;
|
_________________
| Brillia wrote: | | I FUCKING FUCK SEX |
|
|
| Back to top |
|
 |
paupav Master Cheater
Reputation: 13
Joined: 15 Apr 2011 Posts: 314 Location: P. Sherman 42, Wallaby Way, Sydney
|
Posted: Fri Aug 10, 2012 1:30 pm Post subject: |
|
|
| blablfy. wrote: | it returns the value of r. That way in some other part of your code you can do:
| Code: |
cout << divide(6,2) << endl;
|
|
so how much i understood that work this way
r=a/b -> r=6/2
and then return (r); say program to return r to equation
|
|
| Back to top |
|
 |
Evil_Intentions Expert Cheater
Reputation: 65
Joined: 07 Jan 2010 Posts: 214
|
Posted: Fri Aug 10, 2012 2:36 pm Post subject: |
|
|
| Why dont you read a book or tutorial. Or just fucking documentation before posting in fucking RANDOM SPAM
|
|
| Back to top |
|
 |
Monkeys I post too much
Reputation: 29
Joined: 20 Jul 2006 Posts: 2411
|
Posted: Fri Aug 10, 2012 2:44 pm Post subject: |
|
|
Or use your brain.
_________________
Get a lid on that zombie,
he's never gonna be alri-i-ight.
Oooh get a lid on that zombie,
or he's gonna feed all night. |
|
| Back to top |
|
 |
paupav Master Cheater
Reputation: 13
Joined: 15 Apr 2011 Posts: 314 Location: P. Sherman 42, Wallaby Way, Sydney
|
Posted: Fri Aug 10, 2012 2:55 pm Post subject: |
|
|
| Evil_Intentions wrote: | | Why dont you read a book or tutorial. Or just fucking documentation before posting in fucking RANDOM SPAM |
i do, because im not sure if that what im thinking is right
|
|
| Back to top |
|
 |
Evil_Intentions Expert Cheater
Reputation: 65
Joined: 07 Jan 2010 Posts: 214
|
Posted: Fri Aug 10, 2012 2:57 pm Post subject: |
|
|
| paupav wrote: | | Evil_Intentions wrote: | | Why dont you read a book or tutorial. Or just fucking documentation before posting in fucking RANDOM SPAM |
i do, because im not sure if that what im thinking is right |
That's what the BOOK and TUTORIALS are for..damn. You learn something, then practice it. Not copy an example and try to piece together an understanding when you're clearly not ready.
|
|
| Back to top |
|
 |
Kargarok Advanced Cheater
Reputation: 10
Joined: 28 Jul 2011 Posts: 60
|
Posted: Fri Aug 10, 2012 3:14 pm Post subject: |
|
|
AND SO I CRY SOMETIMES WHEN I'M LYING IN BED
JUST TO GET IT ALL OUT, WHAT'S IN MY HEAD
AND I, I'M FEELING A LITTLE PECULIAR
AND SO I WAKE IN THE MORNING AND I STEP
OUTSIDE AND I TAKE DEEP BREATH
AND I GET REAL HIGH
AND I SCREAM TO THE TOP OF MY LUNGS
WHAT'S GOIN' ON?
|
|
| Back to top |
|
 |
|