2
votes
3answers
156 views

What's the best way to retrieve a value and a status [closed]

Given that all else is equal, and there are no coding standards defining the best approach, what would be the recommended way in C++ to check that a value exists and return it if it does? For ...
2
votes
2answers
280 views

Why function returning by Address can not be a Lvalue?

Why it is not possible to make it LValue if a function return by address (while possible in case of reference)? int* returnByAdress() { int x =20; return &x; } int& ...
3
votes
2answers
250 views

Intersection of geometric entities

I was trying to design a small C++ geometric API for learning purposes, but came across a problem when dealing with intersections of geometric entities. For example, the intersection of a line and a ...
2
votes
3answers
1k views

function works fine without return value in c++

I forgot to write return 'a'; in function and return 0; in main function but its works fine in Code::Blocks. #include <iostream> using namespace std; char show() { cout<<"this is show ...