So, the cost of passing a reference or pointer is the cost of passing the number of bytes that a pointer occupies in your environment. I say usually, because the size of a pointer and of most other data types can vary across compilers and versions, so never make assumptions about the size of a pointer or anything else. In a 16-bit environment, a pointer is usually two bytes wide. In a 64-bit environment, a pointer is usually eight bytes wide. In a 32-bit environment, a pointer is usually four bytes wide. They just have a different syntax for using them.) When you call by value, you’re passing a copy of the data. (References are, under the covers, pointers. When a reference or a pointer is passed as an argument into a function, a thing that is the size of a pointer must be passed.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |