Help with sizeof and pointers

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steven C.

    #31
    Re: Help with sizeof and pointers

    Chill out I just asked! I guess it's kind of a religious thing with you.


    Comment

    • Kevin Goodsell

      #32
      Re: Help with sizeof and pointers

      Steven C. wrote:
      [color=blue]
      > Chill out I just asked! I guess it's kind of a religious thing with you.
      >
      >[/color]

      Please quote some context when replying. Assuming your reply was meant
      for me, here's my response.

      I read usenet a lot. I actively participate in groups, and I frequently
      search the archives for information. Correct posting makes everything go
      much more smoothly. It avoids confusion and misunderstandin gs, and keeps
      the discussion organized and easy to follow. It also prevents wasted
      time and space caused by overquoted replies. Isn't that worth a little
      tiny bit of extra effort, especially considering 1) the size of the
      audience (potentially thousands) and 2) the lifetime of the articles
      (maybe forever)?

      It's not as if these are arbitrary rules. They have a purpose, and were
      determined to be the best practices based on experience.

      -Kevin
      --
      My email address is valid, but changes periodically.
      To contact me please use the address from a recent posting.

      Comment

      • Jon Bell

        #33
        [OT] Quoting (Was: Help with sizeof and pointers)

        In article <NfO8b.67839$IJ 6.2019217@twist er.socal.rr.com >,
        Steven C. <nospam@xxx.com > wrote:[color=blue]
        >I'm curious what news reader program u use that is better with bottom
        >posting.[/color]

        Actually, even with Outlook Express it's easy to post "properly". All you
        have to do is start at the top where OE puts you to begin with, and scroll
        down through the quoted text. As you go, delete the stuff that isn't
        directly relevant to your response. When you come to a point that you
        want to respond to, stop scrolling and put your comments after that point.
        Then, if you're not at the end of the message yet, keep scrolling and
        deleting, and inserting more comments if appropriate. Eventually you'll
        reach the bottom, and your comments will be interspersed nicely among the
        remaining quoted material, point/counterpoint style.

        With this procedure, it's actually *better* to have the cursor at the top
        to begin with. If the cursor starts out at the bottom, you have to scroll
        all the way up to the top before you can start working your way down.

        --
        Jon Bell <jtbellap8@pres by.edu> Presbyterian College
        Dept. of Physics and Computer Science Clinton, South Carolina USA

        Comment

        • Jack Klein

          #34
          Re: Help with sizeof and pointers

          On Sat, 13 Sep 2003 03:59:46 GMT, "Steven C." <nospam@xxx.com > wrote
          in comp.lang.c++:
          [color=blue]
          > You have two choices either end your array with a unque int or pass the
          > size.
          >
          > main()
          > {
          > int array[]={1,2,3,4,5,6,7 ,8};
          > function (array, sizeof(array)/sizeof(int))
          > }
          >
          > function(int *array, int size)[/color]
          ^^^

          function(int *array, size_t size)[color=blue]
          > {
          > }
          >
          >
          >
          > "Metzen" <aniled@yahoo.c om> wrote in message
          > news:4e629682.0 309121725.2407d 28d@posting.goo gle.com...
          > hello,
          > ok, I want to find the length of an int array that is being passed to a
          > function:
          >
          > main()
          > {
          > int array[]={1,2,3,4,5,6,7 ,8};
          > function(array) ;
          > }
          > function(int *array)
          > {
          > int arraylen = sizeof(*array)/sizeof(int);
          > }
          >
          >
          > arraylen should be 8 I get 1.
          >
          > What am I doing Wrong?
          >
          > Thanx
          >[/color]

          Comment

          Working...