why do u have long twice?. and its a little hard to read a file opened for writing. and i think the function ur looking for is like seekg or something like that
first use code tags to post your code. if you don't know what that is. Its the button that looks like this <> on the right side of the screen, when you are posting. People are being nice enough to take time out of thier day to help you with your code. Using code tages makes it easier for them.
You can clearly see the differance between the two posts. I should probably mention that my c is a little rusty. Anyway, on line 5 what is this? unsignedlonglongint b =34; I assume it's supposed to be this int b =34; Also take a look at this fp=fopen("g:\\my.txt","w"); is this the right file location? Maybe try the c: drive instead fp=fopen("c:\\my.txt","w");.
@greenleaf800073 The w is for opening the file in write mode.
Edit:
@yanson and DTSCode unsignedlonglongint is a valid data type and is at least a 64 bit unsigned integer, although it is usually written unsignedlonglong or uint64_t if you #include <cstdint>
I'm sorry I did not post as code, I did not know how.
I need it to be unsigned long long int because when I modify it to do what I want it to do it will be using huge numbers much greater than a long int.
the w is for write mode I am trying to write to a file.
I also am having the same trouble with fread when dealing with unsigned long long ints.
the b++ should be in the same statement block ({}) as the fprintf(), else the while loop completes first, then a single fprintf() call is made with b=40.