Go Back   Flash Flash Revolution > General Discussion > Chit Chat
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
Old 07-8-2007, 09:12 AM   #1
dizzyelk
FFR Player
 
Join Date: Jul 2007
Posts: 1
Default multiple definitions error, what's wrong?

I'm getting an error when I try to compile one of my headers. I'm using DevCPP, if that matters. Its a dice roller for a rouge-like I'm trying to write, taking in 2 variables in the format of XdY (for those of you who roleplay).

coding follows...

#ifndef _DICEBAG_H_
#define _DICEBAG_H_

using namespace std;

int diceroll(int numof, int numside) {
int total = 0;
for(int curroll = 0; curroll < numof; curroll++) {
total += rand() % numsides + 1;
}
return total;
}
#endif
dizzyelk is offline   Reply With Quote
Old 07-8-2007, 10:02 AM   #2
Emu Hater
FFR Player
FFR Veteran
 
Emu Hater's Avatar
 
Join Date: Apr 2007
Age: 35
Posts: 230
Default Re: multiple definitions error, what's wrong?

My coding style is completely different so its hard to tell where the problem is. However,
Quote:
int diceroll(int numof, int numside) {
int total = 0;
for(int curroll = 0; curroll < numof; curroll++) {
total += rand() % numsides + 1;
the problem might be because those don't match.
__________________



Tier Points: 270 (261 + 9 for 285 AAAs)
Emu Hater is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 11:29 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright FlashFlashRevolution