- Main Page
- Tutorials
- Functions
- Release Notes
- Examples

Functions
toString
Complete List of ArrayFire Functions

Print the array to a string instead of the screen. More...

## Functions
AFAPI void | toString (char **output, const char *exp, const array &arr, const int precision=4, const bool transpose=true)
AFAPI af_err | af_array_to_string (char **output, const char *exp, const af_array arr, const int precision, const bool transpose)

## Detailed Description

Print the array to a string instead of the screen.

This function is similar to af::print, except that it prints to a string rather than to screen.

## Function Documentation

AFAPI af_err af_array_to_string | ( | char ** | output,
|  | const char * | exp,
|  | const af_array | arr,
|  | const int | precision,
|  | const bool | transpose
| ) |  |

Parameters

  [out] | output | is the pointer to the c-string that will hold the data. The memory for output is allocated by the function. The user is responsible for deleting the memory.
  [in] | exp | is an expression, generally the name of the array
  [in] | arr | is the input array
  [in] | precision | is the precision length for display
  [in] | transpose | determines whether or not to transpose the array before storing it in the string

AFAPI void af::toString | ( | char ** | output,
|  | const char * | exp,
|  | const array & | arr,
|  | const int | precision = `4`,
|  | const bool | transpose = `true`
| ) |  |

Parameters

  [out] | output | is the pointer to the c-string that will hold the data. The memory for output is allocated by the function. The user is responsible for deleting the memory.
  [in] | exp | is an expression, generally the name of the array
  [in] | arr | is the input array
  [in] | precision | is the precision length for display
  [in] | transpose | determines whether or not to transpose the array before storing it in the string