I want to be able to read a file (in Hex format) and place it into a byte[] array. If someone could code this for me and include comments where necessary. Thanks.
This isn't for school or education. I'm learning C++ for my own purpose. This would help me a-lot of C++. It would explain something I've always been confused about.
The code is kind of in 'testing state'. I want oData to become a byte array. I was thinking of passing a pointer to a byte array to this function so I could write to that specific byte array.
This won't tell you the size of the file. You're asking where the get pointer is, hint: it hasn't moved since you opened the file, and then you setting the get pointer back to the beginning of the stream. You're obviously using the WinAPI in other parts of your code so why not just stick with it? "GetFileSize()" is a pretty straight forward function: http://msdn.microsoft.com/en-us/library/windows/desktop/aa364955(v=vs.85).aspx . Let us know if you need help with it. Regarding the name of this function, are you working with a network stream? Because if that's the case then we need to rethink this whole thing. Also, what's the thing you've been confused about? I can understand if you want to figure it out for yourself but I'd like to at least offer you an answer.
EDIT: D'oh! I missed the "ios::ate" on Line 5. I would still encourage you to use "GetFileSize()" but you're fine.