In the following code, I get a segmentation error:
Set *getpar() {...}
char function(...)
{
Set **S;
*S = getpar();
...
}
But the strange thing is that with minor changes there is no segmentation error:
Set *getpar() {...}
...
char function(...)
{
Set *S;
S = getpar();
...
}
As I know, if there is a " Set **S", then it *Sis a pointer to an object Set, therefore, if the second code works fine, why should not it be the first? *SThe first code is equivalent to the Ssecond code, right? How can i solve the problem?
source
share