- Those are simple bit map constants Read=1 Write=2 CSV=8 so the bitwise or operation result is 11.
- You make your function accept an int/uint and decompose it using the bitwise and operation:type function(... int flags ...){Remember the constants must be powers of 2 (i.e. 1, 2, 4, 8, ...,) so you're limited to 31 of them maximum.
bool isRead = flags & FILE_READ;
bool isWrite = flags & FILE_WRITE;
bool isCSV = flags & FILE_CSV;
whroeder1:
Thanks my frined!
- Those are simple bit map constants Read=1 Write=2 CSV=8 so the bitwise or operation result is 11.
- You make your function accept an int/uint and decompose it using the bitwise and operation:type function(... int flags ...){Remember the constants must be powers of 2 (i.e. 1, 2, 4, 8, ...,) so you're limited to 31 of them maximum.
bool isRead = flags & FILE_READ;
bool isWrite = flags & FILE_WRITE;
bool isCSV = flags & FILE_CSV;
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi all.
How can i make my own function, that accepts parameters in sequence?
Like this : int filehandle=FileOpen(filename,FILE_READ|FILE_WRITE|FILE_CSV);