|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#5
|
|||
|
|||
|
Re: Pointers/References?
Quote:
Quote:
[quote=htwiz2002;567274] Code:
void Terminal_eepromreadset(unsigned char set, unsigned char *data1, unsigned char *data2, unsigned char *data3, unsigned char *data4)
{
//Consolidate this on verify that it works!!!
unsigned int address = set * 4 -1;
*data1 = EEPROM_Read(address + 1);
*data2 = EEPROM_Read(address + 2);
*data3 = EEPROM_Read(address + 3);
*data4 = EEPROM_Read(address + 4);
}
![]() Quote:
Also, why are you using global variables here instead of declaring them inside this function? Also, perhaps you should name your case.... Code:
#define VERSION_SET (0) .... ... case VERSION_SET: .... Code:
default:
return 999;
break;
A programmer's job is to write documentation that happens to compile.... ![]() Suggestions: Use whitespace, it's free. Avoid global variables like the plague. If you must use globals, stick a 'g' in front of the name, again so that you know it's a global. Make all your globals 'static'. This means that they won't conflict with another global in a different file. That can cause huge headaches. ttyl, --buddy |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| pic: Robonauts' Magnum Shoots 3 Pointers with WNBA Comets | Natchez | Extra Discussion | 8 | 28-10-2006 20:26 |
| Pointers in EasyC | P1h3r1e3d13 | Programming | 6 | 13-03-2006 00:02 |
| Can't use pointers nor refrences. | cibressus53 | Programming | 9 | 05-11-2004 15:44 |
| Pointers to structs? | Jeff McCune | Programming | 2 | 17-02-2004 13:17 |
| Laser Pointers.. | archiver | 2001 | 18 | 24-06-2002 00:08 |