Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUST

rust struct

struct Data {
	randomInfo: String
}

let mut Data {
	randomInfo: "This is a structure"
}

/* 
 The mut keyword defines whether or not you can mutate (change)
 the variable (in this case a structure), so if you don't want tp be able to 
 change the data then don't use the mut keyword. Like so:
*/

let Data {
	randomInfo: "This is a structure"
}
 
PREVIOUS NEXT
Tagged: #rust #struct
ADD COMMENT
Topic
Name
6+9 =