Do I have to use references in C++.? -
this question has answer here:
i have kinda deep c experience c++ beginner. references seem easier use pointers, drives me crazy. think references can replaced pointers. in case, pointers not hard because spent tons of times studying them. common among c++ programmers use references or recommended??
one thing references prevent null pointers. if want ensure parameter passed function not null, can pass reference.
void func(int& i); // cannot null
Comments
Post a Comment