Hello !
I'm writing a program in C++ and I use a struct definition named Contact.
In a function in my program that returns an item of type Contact,i face the problem below:
Contact getContact(){
Contact c;
//do things
if(condition)
//assign c
else
//c is not assigned
return c;
}
So when it goes in else statement,the c remains unassigned,and the return c gives an error of course.
Is there a way to assign it with something like null so the return statement wouldn't face a problem?
Contact is just a simple struct.