News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

how to count a string without aa 0 terminator

Started by Rainstorm, November 08, 2006, 07:57:54 PM

Previous topic - Next topic

Rainstorm

Hi,..

How do i count a string without a 0 terminator
like for exaample with the following decleration.

word1 db "String"

thanks...

EddieB

If you have it declared as so, can you not just use the length? ( '6' )




Tedd

"sizeof word1" will give you its length in the code.
If you do null-terminate it, but want the length not including the zero, then you can do "(sizeof word1)-1"
No snowflake in an avalanche feels responsible.

Rainstorm

Thankyou Ted.

Rainstorm

[edit]
eddieB wrote
QuoteIf you have it declared as so, can you not just use the length? ( '6'
yes, meant the length/(no of chars)....but i wanted to know
how i could get the value  in the code.