Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/11/05 21:23
Read: times


 
#89514 - Acessing struct
Responding to: ???'s previous message
Omar,

You need to declare the struct something like this:-

struct info
{
int name[15];
int age[2];
int birthdate[6];
}datos;

Depending on your compiler there should be a directive to place the struct in external memory. For example in Keil C51 it would be:-

struct info
{
int name[15];
int age[2];
int birthdate[6];
}xdata datos;

You access individual parts of the structure like this:-

nombre = datos.name;

Are you sure you are using the right data types within the structure? I might have done something like this:-

struct info
{
char name[15];
int age;
} xdata datos = { "Paul", 31 };

Hope this all helps,

Paul




List of 5 messages in thread
TopicAuthorDate
memory information using structs            01/01/70 00:00      
   You Need A C Book            01/01/70 00:00      
   Acessing struct            01/01/70 00:00      
   Struct            01/01/70 00:00      
      Avoid Malloc on 8051            01/01/70 00:00      

Back to Subject List