Question: I know that in C the conversion of unsigned to signed integers is implementation defined, but what is it for C++? I figured someone would have asked this already, and I searched but I couldn't find it.

I have a function that operates on an unsigned integer and returns a related unsigned integer. I am passing that function a signed integer by casting to unsigned similar to `int num = -6; unsigned ret = func((unsigned)num); int ret_as_signed = (int)ret;`. In Visual Studio that works fine, but I wonder how portable it is.

Is there a portable way to convert unsigned integers to signed integers? It it possible to just reverse how signed integers are converted to unsigned via wraparound? Thanks

Answer: 
exp1 isn't a pointer. Use

```
exp1.stack = malloc(n);

```
struct saf exp1.stack = malloc(n);

The above statement creates array of *n* memory locations and returns the *void \** pointer to the starting address. In this case *stack* should be single pointer i,e void \*stack;
If you want *stack* to be a double pointer i,e void \*\*stack then you should use

exp1.stack=malloc(sizeof(void \*)\*n);