Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. mbozza

    Pointer arithmetic and scope

    Thanks for the reply "What makes you think you've got access to the data at 0x00123ABC?" The code is in a dll, which is loaded by the program. The memory in question has at least read permission. "I'd expect even the first program to crash." The first function works fine. Refering to the...
  2. mbozza

    New to VC++.net...

    If I understand your post correctly you are new to C++, in which case you would do well to concentrate on the purely C++ language aspects and forget about which particular compiler you happen to be using.
  3. mbozza

    Pointer arithmetic and scope

    I'm writing a memory viewer which can both display a block of process memory and dump it to file. The following function works fine. void SomeFunction(void) { char* buf = (char*) 0x00123ABC; for(int i = 0; i < bigNumber; i++) { fprintf(fp, "%x", *buf); } } However if I try this below...
  4. mbozza

    simple fwrite error, or something deeper?

    >Why isn't stream_size just an integer? >It would save all this casting... >myStream = *((int*) db->stream_size); Good question. Partly because it suited me of old and hasn't been subsequently amended in the development process. Partly for aesthetic reasons - which shouldn't figure at all...
  5. mbozza

    simple fwrite error, or something deeper?

    Thank you for your advice. I have solved the problem of the 'skipped' bytes. My source file is a C file, e.g. foo.c Here is my code till now (bare essentials). My problem now is how to allocate enough memory dynamically in order to read in fairly large files (3-5Mb). Although I know the...
  6. mbozza

    simple fwrite error, or something deeper?

    Yes, I am compiling with Visual C++. The reason I was taking the address of the pointer was because most of the code used to be in functions, passed a pointer to struct. I moved my code back up into main to see if it would cure the problem and kinda forgot to change it. The code now works in...
  7. mbozza

    simple fwrite error, or something deeper?

    I get this wierd output, both to file and screen. At certain points, I think at 32 or 36 bytes in, the data reads in ok but writing out seems write ahead or skip bytes, writing the *member variable oddly, with part of the next variable, *member_size added on. I feel that maybe I am seeing some...
  8. mbozza

    structure members

    thanks, I think that last bit - (*n)[i]; - is the killer line I needed all the time. thanks once again.
  9. mbozza

    structure members

    I am having problems accessing certain structure members, namely char* members. Instead of reading along the Char* array, it is incrementing it. What am I doing wrong? #include <stdio.h> #include <stdlib.h> #define NAME 1162690894 // read as 4 bytes, spells NAME void prnt_block( struct...

Part and Inventory Search

Back
Top