- #1
Demon117
- 165
- 1
Code:
#include <iostream>;
using namespace std;
double w = 3.4;
bool p = true;
long foo(int a, int b);
void goo(int &a, double b);
float soo(long a, double b);
bool too(double b);
int boo();
int main()
{
int c,d;
c = 4;
d = c * 3;
cout << foo(c,d) << endl;
cout << c << " " << d << endl;
goo (c,d);
cout << d << endl;
cout << soo(c,d) << endl;
cout << 23 || too(d) << endl;
for (int i = 0; i < 4; i++) cout << boo();
cout << endl;
return 0;
}
/*****************************************************/
long foo(long a, int b)
{
a = 4;
w = a * 3.1;
return a * b;
}
/****************************************************/
void goo(long &a, double b)
{
a = b * 4 * w;
}
/****************************************************/
float soo(long a, double b)
{
return b * w * a;
}
/****************************************************/
bool too(double b)
{
return a == b && true || 0;
}
/****************************************************
this function should generate a number one higher than the previous time called */
int boo()
{
static int f;
f = 0;
f ++;
return f;
}
/****************************************************/
void roo (single &a, single b)
{
single foo; foo = a; a = b; b = foo;
}
/****************************************************
when should you use a static varable vs a global variable? */
void loo ()
{
p = !p;
return p
}
Can anyone point out the errors? I get confused when I try to read through this and I've been trying to figure it out for a few days now.