you were right dude ,, thx i fixed the mistakes and at the end there was only one left..i already changed the void main to int main
Error 1 error C2084: function 'int main(void)' already has a body
PHP Code:
# include <iostream>
using namespace std;
void sFune();
int main()
{ for (int i=0; i<3; i++)
sFune();
}
void sFune ()
{
static int x=2;
int y=2;
x++;
y++;
cout << " X = "<<x<<endl;
cout << " Y = "<<y<<endl;
}
class secretClass
{
public :
void set ( int a)
{
y = a;
}
void printY()
{
cout <<y<<endl;
}
static void printNum ()
{
cout <<num<<endl;
}
static void increase(int n)
{
num+=n;
}
secretClass ( int a=0)
{
y=0;
num ++;
}
private :
int y;
static int num;
};
int secretClass::num=10;
int main ()
{
secretClass obj1(50);
secretClass::printNum();
secretClass obj2(20);
secretClass::printNum();
obj1.increase(5);
obj2.increase(2);
obj1.printY();
obj2.printY();
secretClass::increase(10);
obj1.printNum();
return 0;
}