Home »
Julia
C_NULL Constant in Julia
Julia | C_NULL Constant: In this tutorial, we are going to learn about the C_NULL constant with examples in Julia programming language.
Submitted by IncludeHelp, on April 02, 2020
Julia | C_NULL Constant
C_NULL is a constant of Ptr{Nothing} type in Julia programming language, it represents the null pointer value, which is used for C Null Pointer while calling external code.
Syntax:
C_NULL
Example:
In this example, we are taking a variable x and assigning it with C_NULL. We are printing the value and type of x using using println() function and typeof() function.
# Julia example of C_NULL
x = C_NULL
println("x: ", x)
println("typeof(x): ", typeof(x))
Output
x: Ptr{Nothing} @0x0000000000000000
typeof(x): Ptr{Nothing}
Reference: Julia constants