Operating System - HP-UX
1834441 Members
2286 Online
110067 Solutions
New Discussion

Re: Are character variables WORD ALIGNED?

 
Reggie Chang
Frequent Advisor

Are character variables WORD ALIGNED?

Hello there,

We are trying to convert a FORTRAN code from
SGI to HP-UX 10.20.

Questions:
1. Are character variables WORD ALIGNED?
2. How to find out word length in charaters?

All the info is appreciated.

Reggie
1 REPLY 1
Hartmut Lang
Trusted Contributor

Re: Are character variables WORD ALIGNED?

1. Characters are (per default) aligned to 1 byte.
See http://www.docs.hp.com/hpux/onlinedocs/92434-90011/92434-90011.html

Normaly you can change the alignment of datatypes. The way to do this is compiler-specific (differnt for HP COmpiler and gcc). In most cases this will lead to slower and bigger code. Which might or might not be a problem.

2. Do not really understand your question. Do you want to know the length of a character-string (strlen())?

Hartmut