Next: Combination Examples, Previous: Combination functions, Up: Combinations
The library provides functions for reading and writing combinations to a file as binary data or formatted text.
This function writes the elements of the combination c to the stream stream in binary format. The function returns
GSL_EFAILED
if there was a problem writing to the file. Since the data is written in the native binary format it may not be portable between different architectures.
This function reads elements from the open stream stream into the combination c in binary format. The combination c must be preallocated with correct values of n and k since the function uses the size of c to determine how many bytes to read. The function returns
GSL_EFAILED
if there was a problem reading from the file. The data is assumed to have been written in the native binary format on the same architecture.
This function writes the elements of the combination c line-by-line to the stream stream using the format specifier format, which should be suitable for a type of size_t. On a GNU system the type modifier
Z
representssize_t
, so"%Zu\n"
is a suitable format. The function returnsGSL_EFAILED
if there was a problem writing to the file.
This function reads formatted data from the stream stream into the combination c. The combination c must be preallocated with correct values of n and k since the function uses the size of c to determine how many numbers to read. The function returns
GSL_EFAILED
if there was a problem reading from the file.