is this possible...?

Started by
13 comments, last by 21st Century Moose 13 years, 1 month ago
int function(...)
{
int x;
int q;


if (condition)
{
}

<-----is there a way to put a marker here...then use a pointer to store the address of the marker...right before the 2nd conditional statement in my code?

if (condition2)
{

}


return val;
}
Advertisement
It sounds possible, depends on what you're trying to store. Give me more info and i may be able to help.
int function(...)
{
int x;
int q;


if (condition)
{
}

return function2(x, q);
}

int function2(...)
{
if (condition2)
{

}


return val;
}



You could just do something like that. It's hard to tell without some real code >.<
What are you trying to do? If you want to jump to a specific part of the code, that is generally frowned on. It makes for very unreadable and unmaintainable code. If you are just trying to debug, just put a statement there such as a printf().
im trying to use the address,hardcoded at compile time, to read in the bytes starting at that address till the end of the return and store all these bytes into a buffer..... -thx

im trying to use the address,hardcoded at compile time, to read in the bytes starting at that address till the end of the return and store all these bytes into a buffer..... -thx


>.< But why? You could use a function pointer address and try and increment it by some value I guess. But what are you trying to accomplish?
So are you trying to have the program read a portion of itself? If so, why?

edit: Also, if I understand correctly, I think you will be reading the actual compiled x86 instructions. That is, if you're looking to get variable values, those will be stored elsewhere, in the stack or heap.
When you say "all these bytes" what bytes are you referring to? Some section of compiled machine code? I agree with others that the better question is what problem are you attempting to solve with this so you can be given a better solution.
im wanting to read my compiled code at a certain point(which i specify) read it into a buffer, and then be able to copy those bytes to a file for viewing...!
oh, that's not supported by the standard AFAIK.

Just use visual studio to look at the compiled code.

This topic is closed to new replies.

Advertisement