Quantcast
Channel: Is aggregate initialization with a new struct valid? - Stack Overflow
Browsing all 2 articles
Browse latest View live

Answer by Michael Karcher for Is aggregate initialization with a new struct...

That code will allocate memory for a new Struct and initialize the members with 1, 2 and 3, and finally put the pointer to that structure into the variable a. I have no idea whether you call that...

View Article



Is aggregate initialization with a new struct valid?

Would a phrase such as Struct* a = new Struct{1,2,3}; be valid?It compiles and runs just fine, but I'm wondering if there's anything funky going on behind the scenes.struct Struct { int a; int b; int c;}

View Article
Browsing all 2 articles
Browse latest View live




Latest Images

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