Use of sizeof() | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

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?

23rd Nov 2016, 12:12 AM
The Dave Conspiracy
2 Answers
+ 1
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.
23rd Nov 2016, 2:30 AM
Petr Hatina
Petr Hatina - avatar
0
ty petr hatina , now i know for what is sizeof().
14th Jan 2017, 6:26 PM
Veljko
Veljko - avatar