Click here to Skip to main content
15,890,882 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I speak a little English and I hope you understand. Thank you very much!
I have a problem

In my file has code...
"fseek(fi, 0L, SEEK_SET);"

I don't known what is characters "0L"? As I know this position("0L") is a number, but this has "L". You can explain to me? Thank you very much.
Posted

Google is the best way to answer this type of basic question.
If you look at fseek you will find the second parameter offset is a long integer.
www.cplusplus.com/reference/cstdio/fseek/[^]

0L is a way of telling the compiler that you don't want 0 int but you want 0 long int.

http://forums.codeguru.com/showthread.php?154957-What-does-0L-mean&p=427386#post427386[^]
 
Share this answer
 
I guess 0L is to indicate the 0 number is in Long type, as the function requires long number at that point

I remember to indicate 0.0 in floating point, we can write 0.0f too

Hope this help you!

By the way, are you Vietnamese kimnguyentran??
 
Share this answer
 
v2
Comments
kimnguyentran 4-Dec-13 23:58pm    
Thank you @pwasser!

@Monte_Criso! I'm vietnamese.
and you?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900