Hi all,
I have a function, which has to return some int data. In that function there are multiple return statements. There is also possibility that function may return in some cases. Will this result in undefined behavior???
As rmxhaha said, it will indeed. however your compiler should issue a warning that not all paths return properly.
Btw, it's very bad to have a function like this. In fact the coding conventions in my old company forbade us to write large functions with more than one return statement.