473,407 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Reading a null terminated byte

I'm reading a binary file. Apparently its older, and some of its values are based not on position, but on null terminated bytes.

Meaning...

Position 17 thru 35 represents a value, however, if their is a null byte at 30, then you get garbage if you try to read 17 thru 35 as a value...

I need to read, specifically, from 17 to 29 in this instance because pos 30 is a null byte.

Have to read it byte by byte, no problem. Not sure though the syntax of comparing a null byte specifically.

If you need a sample of the binary file, I can post it.
Mar 29 '11 #1
1 1699
kadghar
1,295 Expert 1GB
Not sure, but have you tried with ISNOTHING() function inside a FOR or a FOR EACH?
Mar 29 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Barry | last post by:
Hi all! I support a rather large production EDI application with a number of C programs, and I ran across a very interesting problem. I have some code that used to work just fine for years, and...
3
by: Michel Racicot | last post by:
I need to read a null terminated ASCII string from a FileStream. How can I do that? I know that with FileStream.ReadByte, I can read until I get a byte == 0 but how can I convert a single byte to...
5
by: B Vidyadhar Joshi | last post by:
I have a function which takes a NOT NULL terminated PWCHAR. int myFunction (PWCHAR pszKey, ULONG ulKeyLen); I have to pass a 4 charecter value to the "key" parameter. For example, "1111". How...
2
by: Ithaqua | last post by:
How do you create them? -- Cheers Ithaqua
3
by: Carlo Stonebanks | last post by:
I need to read a binary file which has mixed data types embedded in it. Fixed length strings, 16-bit integers and zero (null) terminated ASCII strings. (akak ASCIIZ) The first two types are no...
2
by: Steve Barnett | last post by:
I need to call a Win32 function that returns a set of string values. Each value is terminated by a null and the last value is terminated by two nulls. How do I code for this in C#? The call is:...
12
by: semut | last post by:
Given that the string is of null terminated type. What could be the possible causes (by experience) the string to have no null terminated and cause buffer overflow later. I know it is quite broad,...
7
by: semut | last post by:
Given that the string is of null-terminated type. What could be the possible causes (by experience) the string to have no null character (\0) and cause buffer overflow later. I know it is quite...
2
by: nagesh0280 | last post by:
Hi experts, I'm from a Verilog HDL background and trying to learn C. There are a lot of similarities between Verilog and C but the concept of char arrays and strings has me confused. I'd...
5
by: ssylee | last post by:
If I'm being supplied with a char* that is not null-terminated, is it impossible to transform it into a null terminated char* with only abstract information about the char* information?
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.