--- cpssband cpssband wrote:
> <snip>
> typedef struct {
>   Char name[2];
>   UInt8 reserved;
> } MyRecordType;
> 
> when i try to save a record ...
> <snip>
> a = "nasri";

How many bytes do you think it takes to store 'n', 'a', 's', 'r', 'i',
'\0' ?

The size of MyRecordType is 3 bytes; two Chars, followed by one UInt8.

> StrCopy(newrecord.name,a) ;
> <snip>
> however, it comes out 'na0' ....
> anybody knows the reason ?? it only can accept 3
> characters ?? 

That should be obvious now.

> how do i define MyRecordType so that
> 'name' field can accept whatever user enter regardless
> on how many characters it have ...

I expect that there really is an upper limit on how many chars will be
in any name field in your database.  Therefore, why not change your
structure definition to that size.  For example,

 typedef struct {
   Char name[30];
   UInt8 reserved;
 } MyRecordType;


__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards�
http://movies.yahoo.com/

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to