Go to Post what is it exactly that makes people like Dave Lavery more admirable than the video store clerk down the street? - Madison [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Spotlight this post!  
Unread 26-01-2009, 18:43
Ryan O's Avatar
Ryan O Ryan O is offline
FRC Eclipse Plug-in Developer
no team (FRC Eclipse)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Plaistow
Posts: 111
Ryan O is an unknown quantity at this point
Send a message via AIM to Ryan O
Re: multiple definition Problem

I would recommend using the second method dem. mentioned - it's a good habit to get into. Basically, it checks to see if anything called RANDOM_VALUE_YOU_WONT_USE has been defined yet, via the #ifndef line - everything between it and the #endif is skipped if the symbol after it has been defined previously. If it has not been defined, it defines it (#define) and then does whatever. It helps keep code and such from being accidentally repeated. The RANDOM_VALUE_YOU_WONT_USE should be replaced with a unique and descriptive title, such as MOTOR_CLASS_SYMBOL for your motor header. One thing to be careful of - don't repeat a title, as it skip the code if it has been defined elsewhere first - (that's what it's meant to do in this case, after all - So just name it something you know wouldn't be used again - and don't worry about it being long (you'll only be typing it twice, after all)
__________________
CRUD Name: Windows
Rookie Year: 2005
Alumni to Team: 350
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Definition of orthogonal.... fhobart General Forum 9 08-01-2009 12:38
[FTC]: Multiple Programs or One Program with Multiple Auto Modes kevin51292 FIRST Tech Challenge 4 02-01-2009 20:37
definition of FUNCPTR shavol Programming 6 28-12-2008 19:00
Hosting multiple sites in multiple VMs EHaskins Website Design/Showcase 6 22-12-2007 01:09
multiple definition error in MCC/Linker (possible bug?) wun Programming 5 01-04-2004 17:49


All times are GMT -5. The time now is 03:15.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi