0

help please ok here is my code

void sleep()
{
      energy 100;
      happy + 20;
      strength - 1;
      bladder 70;
      age + (hour * 8);
};

ok? all the varibles are preprocesser defined, you know #define energy 100.

i have 2 file in this project main.cpp and Brandon.cpp, the funciton is in the Brandon file

so i run the code once and everything goes ok but once i put it in the main file it says "multiple definition of "sleep()"
why?!? arg frustrating, please help.

3
Contributors
5
Replies
6
Views
8 Years
Discussion Span
Last Post by Brandon515
0

when you say "put it", do you mean you copy the whole function
and redefine it in main?

no i mean

int main()
{
     sleep();
     cout << energy;
}
0

help please ok here is my code

void sleep()
{
      energy 100;
      happy + 20;
      strength - 1;
      bladder 70;
      age + (hour * 8);
};

ok? all the varibles are preprocesser defined, you know #define energy 100.

If this is true, what does the statement 100 100; do? (first statement)
What does happy + 20; do?

All I see are compiler errors.

0

If this is true, what does the statement 100 100; do? (first statement)
What does happy + 20; do?

All I see are compiler errors.

yeah, i just realized that those dont do anything but regardless i get past compiling and it links then it tells me that.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.