Thread: Count the posts

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User raimo's Avatar
    Join Date
    Jun 2002
    Posts
    107
    That is not the case. When a pointer is passed as a parameter to sizeof it returns the size of the pointed structure in bytes. Therefore this statement (sizeof(hello)/sizeof(int)) returns the number of elements in the array of type int*.
    But this won't work for dynamically allocated arrays which was not the case.
    Last edited by raimo; 06-29-2002 at 11:29 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. bintree and count (withouth using template)?
    By cubimongoloid in forum C++ Programming
    Replies: 7
    Last Post: 05-24-2009, 06:22 AM
  2. input question
    By piyush_v in forum C Programming
    Replies: 9
    Last Post: 04-12-2007, 07:09 AM
  3. Program Crashing
    By Pressure in forum C Programming
    Replies: 3
    Last Post: 04-18-2005, 10:28 PM
  4. count only lines of code...
    By flightsimdude in forum C Programming
    Replies: 13
    Last Post: 09-23-2003, 07:08 PM
  5. posts per day cant count
    By iain in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 08-13-2001, 09:18 AM