Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • Could you explain more memory usage when using pointers to simple types? Commented Apr 28, 2012 at 10:51
  • 1
    "they consume more memory" - you mean the extra 4 or 8 bytes per instance for the DWORD or QWORD that contains the address of the data? I'd say the fact that pointers make it easy to forget to clean them up (i.e. free() them) is a much bigger issue. Commented Apr 28, 2012 at 10:51
  • Yes well as Polynomial already said people forge to free them up and yes they consume extra 4 or 8 bytes. Why do I want extra 4 or 8 bytes if not necessary? Commented Apr 28, 2012 at 10:53
  • ya i agree with you, but when we pass array in a function. we can keep formal parameter either of int *a or int a[]. Can you elaborate this issue? Commented Apr 28, 2012 at 10:54
  • I think he meant that you shouldn't use create specific pointer for work with array of char[2] for example. Because pointer has 8 bytes size or 4 in different environment or compiler. Commented Apr 28, 2012 at 10:55