Quantcast
Channel: Active questions tagged return-value - Stack Overflow
Viewing all articles
Browse latest Browse all 210

Returning different data type depending on the data (C++)

$
0
0

Is there anyway to do something like this?

(correct pointer datatype) returnPointer(void* ptr, int depth){    if(depth == 8)        return (uint8*)ptr;    else if (depth == 16)        return (uint16*)ptr;    else        return (uint32*)ptr;}

Thanks


Viewing all articles
Browse latest Browse all 210

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>