Hi guys and gals,
I'm trying to write a small tool in C, and while my programming experience is decent in object Pascal, C# and PHP, my C skills are next to nowhere.
Most of the tool is working correctly, but two issues remain:
- writing a fixed binary value to file
- writing a timestamp to file.
I know how to read/write binary streams from a char* type using the function
fwrite but I can't figure out how to write a single byte (say: FF) to the same file.
The timestamp is of type time_t and the following is therefore not allowed:
Code:
fwrite(timestamp, 1, sizeof(timestamp), fp)
I'm creating the tool for logging a stream, and while I got that part working, it is adding timestamps that's puzzling me. (the FF is for differentiating between timestamp and actual data).
Any help or pointers (*ouch*) is greatly appreciated.