I am trying to learn Vector implementation in Julia. (1.7.1)
Following code gives :Candidate not defined" error.
The code has taken from the question here.
Stack overflow
What is wrong here? what is the correct way?
const max_candidates = 9
candidates = Vector{Candidate}(undef, max_candidates)
for i in 1:max_candidates
println("Name of the candidate: ?")
name = readline();
println("Votes on him: ?")
votes = parse(Int, readline());
candidates[i] = Candidate(name, votes)
println("Thank you, let us move to the next candidate.")
end