cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
problem in reading file
problem in reading file
Nov 14, 2011 at 5:27pm UTC
sarah ghanem
(2)
i want to read this hex values from a file "8F 78 C6 12 BA 98 A2 16" and put this value in a variable long long and to ignore the separators to be the value like this long long temp=0x8f78c612baa216;
how i can do this thanks in advance :)
Nov 14, 2011 at 5:38pm UTC
codekiddy
(783)
hi,
I'm not shore but string class may help you.
1
2
string val; val.append();
to read values use ifstream class.
then convert string to long( don't know how).
Last edited on
Nov 14, 2011 at 5:40pm UTC
Nov 14, 2011 at 6:33pm UTC
modoran
(2077)
Use a char buffer to read 8 bytes from the file, then just cast to long long. Beware about the endianness. (little endian vs big endian).
Topic archived. No new replies allowed.