Use of sizeof() | SoloLearn: Learn to code for FREE!


Use of sizeof()

What's the use of sizeof()? I'm not quite sure when I'd need the size of a variable. What kind of things can I use it for when making programs?

11/23/2016 12:12:24 AM

The Dave Conspiracy

2 Answers

New Answer


The sizeof() is a very helpfull function to programming harder in C++. For create a more efective access with pointers, structures, arrays, files. To allocate dynamic structures in memory, moving large data, make conversations, parsing and so on... In these harder techniques yoou need to calculate the right lenght of data in bytes. Of course, for a beginners programming you need not it.


ty petr hatina , now i know for what is sizeof().