CForm

CForm[expr]

prints as a C language version of expr.

Details

  • Standard arithmetic functions and certain control structures are translated.
  • No declarations are generated.
  • CForm acts as a wrapper, which affects printing, but not evaluation.

Examples

open allclose all

Basic Examples  (1)

A C language version of a polynomial:

In[1]:=
Click for copyable input

A mixed numeric and symbolic expression:

In[2]:=
Click for copyable input

Scope  (1)

Applications  (1)

Properties & Relations  (2)

Possible Issues  (1)

See Also

FortranForm  Compile

Tutorials

Introduced in 1988
(1.0)