Hi guys, this is my first post. I'm a guy and I like programming C. I study at university and I hope to find here friendly people :)
Now I've got this problem.
I've constructed a struct like this:
struct alfa
{
uint32_t beta1;
uint32_t beta2;
};
struct alfa gamma;
Then I need to move cursor with an fseek(), so:
fseek(file,gamma.beta1,SEEK_CUR);
the result is wrong...but why?!
gamma.beta1 is not like a normal int?! how can I do to move cursor about beta1 value?
3 replies to this topic
#1
Posted 17 October 2010 - 03:40 AM
|
|
|
#2
Posted 17 October 2010 - 02:53 PM
Ok...by "cursor" do you mean the cursor on the screen? You can't do that by fseek'ing. Otherwise I have no idea what you meant.
sudo rm -rf /
#3
Posted 17 October 2010 - 09:00 PM
@Dargueta, Probably an accidental reference to something from another language, he means position.
Where did you initialize gamma.beta1 in your script? How is the result "wrong"?, you left out a lot of information.
stefanostefano said:
the result is wrong...but why?!
Where did you initialize gamma.beta1 in your script? How is the result "wrong"?, you left out a lot of information.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#4
Posted 17 October 2010 - 09:05 PM
@Nullw0rm: I've seen this problem before, so I had to ask.
@stefanostefano: You have to set gamma.beta1 to some reasonable value before using it in fseek(). Otherwise, who knows what bizarre value it'll hold. Could be -234874 for all we know.
@stefanostefano: You have to set gamma.beta1 to some reasonable value before using it in fseek(). Otherwise, who knows what bizarre value it'll hold. Could be -234874 for all we know.
sudo rm -rf /
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

Back to top









