Pointer initialization question...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Old Wolf

    #16
    Re: Pointer initialization question...

    Flash Gordon wrote:[color=blue]
    > "No Such Luck" <no_suchluck@ho tmail.com> wrote:[color=green]
    > > Martin Ambuhl wrote:
    > >[color=darkred]
    > > > And learn to indent your code.[/color]
    > >
    > > Google Groups removes indentations from posts. My code was[/color][/color]
    indented.[color=blue]
    >
    > Then use a real news client with a real news server. If your ISP does
    > not provide a news server then the people at[/color]
    http://news.individual.net/[color=blue]
    > provide one for free. I'm sure I'm not the only one who tends to not
    > bother reading code with no formatting.[/color]

    news.individial .net doesn't let you post from a web browser.

    Many computers have a web browser and not a usenet client,
    and many computers do not give administrator access to the
    user (eg. at an internet cafe). Google Groups would be good
    if it didn't fuck up the formatting.

    Comment

    • Old Wolf

      #17
      Re: Pointer initialization question...

      Flash Gordon wrote:[color=blue]
      > "No Such Luck" <no_suchluck@ho tmail.com> wrote:[color=green]
      > > Martin Ambuhl wrote:
      > >[color=darkred]
      > > > And learn to indent your code.[/color]
      > >
      > > Google Groups removes indentations from posts. My code was[/color][/color]
      indented.[color=blue]
      >
      > Then use a real news client with a real news server. If your ISP does
      > not provide a news server then the people at[/color]
      http://news.individual.net/[color=blue]
      > provide one for free. I'm sure I'm not the only one who tends to not
      > bother reading code with no formatting.[/color]

      news.individial .net doesn't let you post from a web browser.

      Many computers have a web browser and not a usenet client,
      and many computers do not give administrator access to the
      user (eg. at an internet cafe). Google Groups would be good
      if it didn't fuck up the formatting.

      Comment

      • Flash Gordon

        #18
        Re: Pointer initialization question...

        On 28 Dec 2004 14:05:59 -0800
        "Old Wolf" <oldwolf@inspir e.net.nz> wrote:
        [color=blue]
        > Flash Gordon wrote:[color=green]
        > > "No Such Luck" <no_suchluck@ho tmail.com> wrote:[color=darkred]
        > > > Martin Ambuhl wrote:
        > > >
        > > > > And learn to indent your code.
        > > >
        > > > Google Groups removes indentations from posts. My code was
        > > > indented.[/color]
        > >
        > > Then use a real news client with a real news server. If your ISP
        > > does not provide a news server then the people at
        > > http://news.individual.net/
        > > provide one for free. I'm sure I'm not the only one who tends to not
        > > bother reading code with no formatting.[/color]
        >
        > news.individial .net doesn't let you post from a web browser.
        >
        > Many computers have a web browser and not a usenet client,
        > and many computers do not give administrator access to the
        > user (eg. at an internet cafe). Google Groups would be good
        > if it didn't fuck up the formatting.[/color]

        Or lead you in to posting twice? :-P

        Seriously, I know that in some situations one does not have the option
        of a real news client, but a lot of people (not you) use Google because
        they don't know there is any other option.

        Of course, all the Google users could try complaining about Google
        screwing up the formatting. They *might* do something about it.
        --
        Flash Gordon
        Living in interesting times.
        Although my email address says spam, it is real and I read it.

        Comment

        • Mark McIntyre

          #19
          Re: Pointer initialization question...

          On 28 Dec 2004 00:46:56 -0800, in comp.lang.c , "No Such Luck"
          <no_suchluck@ho tmail.com> wrote:
          [color=blue]
          >
          >Flash Gordon wrote:[color=green]
          >>
          >> The problem for you is that if you get the people who can help you to
          >> killfile you then you will find yourself not getting any help.[/color]
          >
          >No, the problem for you is that if half the people here help others
          >unconditionall y, and the other half bitches about "not reading the FAQ"
          >and "asking obvious homework questions" and eventually killfiles me,
          >I'll still get a bunch of help.[/color]

          Given the people who you're encouraging to killfile you are the people who
          know the answers to your question, its more likely you;ll get a bunch of
          nonsense answers. Your decision tho.


          --
          Mark McIntyre
          CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
          CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt >

          ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
          http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
          ----= East and West-Coast Server Farms - Total Privacy via Encryption =----

          Comment

          • No Such Luck

            #20
            Re: Pointer initialization question...


            Mark McIntyre wrote:[color=blue]
            > On 28 Dec 2004 00:46:56 -0800, in comp.lang.c , "No Such Luck"
            > <no_suchluck@ho tmail.com> wrote:
            >[color=green]
            > >
            > >Flash Gordon wrote:[color=darkred]
            > >>
            > >> The problem for you is that if you get the people who can help you[/color][/color][/color]
            to[color=blue][color=green][color=darkred]
            > >> killfile you then you will find yourself not getting any help.[/color]
            > >
            > >No, the problem for you is that if half the people here help others
            > >unconditionall y, and the other half bitches about "not reading the[/color][/color]
            FAQ"[color=blue][color=green]
            > >and "asking obvious homework questions" and eventually killfiles me,
            > >I'll still get a bunch of help.[/color]
            >
            > Given the people who you're encouraging to killfile you are the[/color]
            people who[color=blue]
            > know the answers to your question, its more likely you;ll get a bunch[/color]
            of[color=blue]
            > nonsense answers. Your decision tho.[/color]

            Well, look at this thread. Most people have offered help, either after
            complaining that I didn't read the FAQ or not. All help offered,
            however, has been correct and contains a high degree of correlation
            between them.

            Comment

            • infobahn

              #21
              Re: Pointer initialization question...

              Old Wolf wrote:[color=blue]
              > xarax wrote:
              >[color=green]
              >>"dragoncode r" <pktiwary@gmail .com> wrote in message
              >>[color=darkred]
              >>>void init_array (int ** array, int num)
              >>>{
              >>>*array = (int *)malloc(sizeof (int) * num);[/color]
              >>
              >> *array = malloc(num * sizeof **array);
              >>OR:
              >> *array = calloc(num,size of **array);
              >>[color=darkred]
              >>>}[/color][/color]
              >
              >
              > calloc does not generate null pointers.[/color]

              Stuff and nonsense. The Standard says:


              4.10.3.1 The calloc function

              [...]

              Returns

              The calloc function returns either a null pointer or a pointer to
              the allocated space.


              As you can see, the calloc function certainly can generate a null
              pointer if necessary.

              Comment

              • Ben Pfaff

                #22
                Re: Pointer initialization question...

                infobahn <infobahn@btint ernet.com> writes:
                [color=blue]
                > Old Wolf wrote:[color=green]
                >> xarax wrote:
                >>[color=darkred]
                >>>"dragoncoder " <pktiwary@gmail .com> wrote in message
                >>>
                >>>>void init_array (int ** array, int num)
                >>>>{
                >>>>*array = (int *)malloc(sizeof (int) * num);
                >>>
                >>> *array = malloc(num * sizeof **array);
                >>>OR:
                >>> *array = calloc(num,size of **array);
                >>>
                >>>>}[/color]
                >> calloc does not generate null pointers.[/color]
                >
                > Stuff and nonsense.[/color]

                That's what I thought at first, too, but it was pretty clear to
                me, on rereading, that "Old Wolf" actually meant that any
                pointers *inside the allocated region* are not necessarily set to
                null by calloc(). He could certainly have phrased it better.
                --
                "It would be a much better example of undefined behavior
                if the behavior were undefined."
                --Michael Rubenstein

                Comment

                • infobahn

                  #23
                  Re: Pointer initialization question...

                  Ben Pfaff wrote:[color=blue]
                  > infobahn <infobahn@btint ernet.com> writes:
                  >
                  >[color=green]
                  >>Old Wolf wrote:
                  >>[color=darkred]
                  >>>calloc does not generate null pointers.[/color]
                  >>
                  >>Stuff and nonsense.[/color]
                  >
                  > That's what I thought at first, too, but it was pretty clear to
                  > me, on rereading, that "Old Wolf" actually meant that any
                  > pointers *inside the allocated region* are not necessarily set to
                  > null by calloc(). He could certainly have phrased it better.[/color]

                  If he meant that all-bits-zero doesn't necessarily mean NULL, then
                  I owe him an apology. If he didn't, I don't. :-)

                  Comment

                  • Lawrence Kirby

                    #24
                    Re: Pointer initialization question...

                    On Tue, 28 Dec 2004 00:46:56 -0800, No Such Luck wrote:

                    ....
                    [color=blue]
                    > No, the problem for you is that if half the people here help others
                    > unconditionally , and the other half bitches about "not reading the FAQ"
                    > and "asking obvious homework questions" and eventually killfiles me,
                    > I'll still get a bunch of help.[/color]

                    The question then is whether you consider this sufficient justification
                    for abusing the newsgroup.

                    Yes, asking a question that is answered in the FAQ IS abuse, although
                    there are certainly worse forms. FAQs exists so that the same topics don't
                    have to be discussed over and over again in the newsgroup. As such looking
                    at them before posting should not be considered optional. Of course there
                    is nothing wrong with discussing the answer in the FAQ further.

                    Lawrence

                    Comment

                    • Mark McIntyre

                      #25
                      Re: Pointer initialization question...

                      On 28 Dec 2004 17:04:44 -0800, in comp.lang.c , "No Such Luck"
                      <no_suchluck@ho tmail.com> wrote:
                      [color=blue][color=green]
                      >> Given the people who you're encouraging to killfile you are the people who
                      >> know the answers to your question, its more likely you;ll get a bunch of
                      >> nonsense answers. Your decision tho.[/color]
                      >
                      >Well, look at this thread. Most people have offered help, either after
                      >complaining that I didn't read the FAQ or not.[/color]

                      *shrug*. And you've also been killfiled by several regulars. You're losing
                      out so far, IMHO.
                      [color=blue]
                      >All help offered,
                      >however, has been correct and contains a high degree of correlation
                      >between them.[/color]

                      The first is unascertainable if you're asking offtopic questions here, and
                      the second could merely mean you got a load of "me too" answers from
                      people trying to look clever, or who also read the wrong book.

                      I repeat: *shrug*.


                      --
                      Mark McIntyre
                      CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
                      CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt >

                      Comment

                      • Joona I Palaste

                        #26
                        Re: Pointer initialization question...

                        Malcolm <malcolm@55bank .freeserve.co.u k> scribbled the following:[color=blue]
                        > "E. Robert Tisdale" <E.Robert.Tisda le@jpl.nasa.gov > wrote[color=green]
                        >> The comp.lang.c newsgroup has more than its share of indigenous trolls.
                        >> You should learn to recognize them and ignore as soon as possible.
                        >>[/color]
                        > You seem to have a troll obsession. In fact we have many irritating posters,
                        > but few trolls, who are people who are deliberately trying to disrupt the
                        > ng.[/color]
                        [color=blue]
                        > More importantly, most of us are adults and professional programmers. We
                        > really aren't interested in this subject.[/color]

                        What Trollsdale calls an "indigenous troll", humans call a "regular" or
                        a "clueful poster".

                        --
                        /-- Joona Palaste (palaste@cc.hel sinki.fi) ------------- Finland --------\
                        \-------------------------------------------------------- rules! --------/
                        "That's no raisin - it's an ALIEN!"
                        - Tourist in MTV's Oddities

                        Comment

                        Working...