Structure Pointer

Discussion in 'C Programming' started by RAKHE, Feb 23, 2007.

  1. RAKHE

    RAKHE Guest

    Hi
    I am having some warning when i used like this
    struct creat_table {
    --------
    ----------
    };
    struct creat_table *table();
    int main()
    {
    struct creat_table *p;
    p =table();
    }
    struct creat_table *table()
    {

    }
    I used to get Some warning like
    Incompatible assignment Please if any body find solution can u
    expalin it
     
    RAKHE, Feb 23, 2007
    #1
    1. Advertising

  2. "RAKHE" <> writes:
    > I am having some warning when i used like this
    > struct creat_table {
    > --------
    > ----------
    > };
    > struct creat_table *table();
    > int main()
    > {
    > struct creat_table *p;
    > p =table();
    > }
    > struct creat_table *table()
    > {
    >
    > }
    > I used to get Some warning like
    > Incompatible assignment Please if any body find solution can u
    > expalin it


    Please don't use silly abbrevations like "u". If you want us to take
    the time to read your article, take the time to spell out the words.

    After I cleaned up the code you posted (removing the "--------" lines,
    adding a dummy member to the structure), it compiled without error.
    My conclusion is that the code you posted differs from the code that's
    giving you the warning. We're not mindreaders; we can't possibly tell
    you what's wrong with your code unless you actually show it to us.

    And you say you got a warning "something like" Incompatible
    assignment. Don't tell us what the warning is like; tell us what it
    really is.

    Write a small complete compilable program that illustrates the
    problem. Post it exactly (copy-and-paste, don't re-type), and tell us
    what the problem is.

    If you're going to post to a newsgroup, it's a good idea to read the
    group for a while, or at least browse the archives. If you had done
    so, this reply would not be necessary, because everything I'm saying
    has already been posted here many many times.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    We must do something. This is something. Therefore, we must do this.
     
    Keith Thompson, Feb 23, 2007
    #2
    1. Advertising

  3. RAKHE

    jaysome Guest

    On 22 Feb 2007 20:42:19 -0800, "RAKHE" <>
    wrote:

    >Hi
    > I am having some warning when i used like this
    > struct creat_table {
    > --------
    >----------
    >};
    > struct creat_table *table();
    > int main()
    > {
    > struct creat_table *p;
    > p =table();
    > }
    > struct creat_table *table()
    > {
    >
    > }
    >I used to get Some warning like
    > Incompatible assignment Please if any body find solution can u
    >expalin it


    I'm really curious as to why you chose to name your struct
    "creat_table" instead of "create_table". We had an incompetent
    programmer working for us who chose to use the same naming convention,
    and we always wondered why in the world he chose to omit the final 'e'
    in "create". I'm not saying you're incompetent--I just want to know
    what your rationale is behind choosing "creat" (which we pronounce
    "kreet") over "create".

    Best regards
    --
    jay
     
    jaysome, Feb 23, 2007
    #3
  4. RAKHE

    santosh Guest

    Re: Structure Pointer

    RAKHE wrote:
    > Hi
    > I am having some warning when i used like this
    > struct creat_table {
    > --------
    > ----------
    > };
    > struct creat_table *table();
    > int main()
    > {
    > struct creat_table *p;
    > p =table();
    > }
    > struct creat_table *table()
    > {
    >
    > }
    > I used to get Some warning like
    > Incompatible assignment Please if any body find solution can u
    > expalin it


    If you want assistance, please post a minimal, compilable program that
    exhibits your problem. Use cut and paste, don't retype. If relevant,
    post the actual text of the compiler's diagnostics, not your rephrased
    version.
     
    santosh, Feb 23, 2007
    #4
  5. RAKHE

    Chris Dollin Guest

    Re: Structure Pointer

    santosh wrote:

    > RAKHE wrote:
    >> Hi
    >> I am having some warning when i used like this
    >> struct creat_table {
    >> --------
    >> ----------
    >> };
    >> struct creat_table *table();
    >> int main()
    >> {
    >> struct creat_table *p;
    >> p =table();
    >> }
    >> struct creat_table *table()
    >> {
    >>
    >> }
    >> I used to get Some warning like
    >> Incompatible assignment Please if any body find solution can u
    >> expalin it

    >
    > If you want assistance, please post a minimal, compilable program that
    > exhibits your problem. Use cut and paste, don't retype. If relevant,
    > post the actual text of the compiler's diagnostics, not your rephrased
    > version.


    Nitpick:

    It's a but difficult to present a compilable example that produces
    "incompatible assignment" messages, assuming that those are
    constraint violations.

    --
    Chris "electric hedgehog" Dollin
    "It's just the beginning we've seen" - Colosseum, /Tomorrow's Blues/
     
    Chris Dollin, Feb 23, 2007
    #5
  6. RAKHE

    u plz Guest

    Re: Structure Pointer

    On Fri, 23 Feb 2007 00:06:33 -0800, jaysome wrote:


    > I'm really curious as to why you chose to name your struct "creat_table"
    > instead of "create_table". We had an incompetent programmer working for
    > us who chose to use the same naming convention, and we always wondered
    > why in the world he chose to omit the final 'e' in "create". I'm not
    > saying you're incompetent--I just want to know what your rationale is
    > behind choosing "creat" (which we pronounce "kreet") over "create".


    OT: Ken Thompson said this about the creat() function call in Unix:

    "If I had to do it over again? Hmm... I guess I'd spell 'creat' with an
    'e'."

    Maybe OP got the inspiration from Ken Thompson.

    -Alok
     
    u plz, Feb 23, 2007
    #6
  7. RAKHE

    santosh Guest

    Re: Structure Pointer

    u plz wrote:
    > On Fri, 23 Feb 2007 00:06:33 -0800, jaysome wrote:
    >
    >
    > > I'm really curious as to why you chose to name your struct "creat_table"
    > > instead of "create_table". We had an incompetent programmer working for
    > > us who chose to use the same naming convention, and we always wondered
    > > why in the world he chose to omit the final 'e' in "create". I'm not
    > > saying you're incompetent--I just want to know what your rationale is
    > > behind choosing "creat" (which we pronounce "kreet") over "create".

    >
    > OT: Ken Thompson said this about the creat() function call in Unix:
    >
    > "If I had to do it over again? Hmm... I guess I'd spell 'creat' with an
    > 'e'."


    He (Ken) said that in jest. There're far more cryptic calls like brk.
     
    santosh, Feb 23, 2007
    #7
  8. RAKHE

    Coos Haak Guest

    Re: Structure Pointer

    Op Fri, 23 Feb 2007 17:31:21 +0000 (UTC) schreef u plz:

    > On Fri, 23 Feb 2007 00:06:33 -0800, jaysome wrote:
    >
    >
    >> I'm really curious as to why you chose to name your struct "creat_table"
    >> instead of "create_table". We had an incompetent programmer working for
    >> us who chose to use the same naming convention, and we always wondered
    >> why in the world he chose to omit the final 'e' in "create". I'm not
    >> saying you're incompetent--I just want to know what your rationale is
    >> behind choosing "creat" (which we pronounce "kreet") over "create".

    >
    > OT: Ken Thompson said this about the creat() function call in Unix:
    >
    > "If I had to do it over again? Hmm... I guess I'd spell 'creat' with an
    > 'e'."
    >
    > Maybe OP got the inspiration from Ken Thompson.


    I use a language that would have been called Fourth if the compiler had
    allowed six letter words ;-)
    --
    Coos
     
    Coos Haak, Feb 23, 2007
    #8
  9. Re: Structure Pointer

    "santosh" <> writes:
    > u plz wrote:
    >> On Fri, 23 Feb 2007 00:06:33 -0800, jaysome wrote:
    >> > I'm really curious as to why you chose to name your struct "creat_table"
    >> > instead of "create_table". We had an incompetent programmer working for
    >> > us who chose to use the same naming convention, and we always wondered
    >> > why in the world he chose to omit the final 'e' in "create". I'm not
    >> > saying you're incompetent--I just want to know what your rationale is
    >> > behind choosing "creat" (which we pronounce "kreet") over "create".

    >>
    >> OT: Ken Thompson said this about the creat() function call in Unix:
    >>
    >> "If I had to do it over again? Hmm... I guess I'd spell 'creat' with an
    >> 'e'."

    >
    > He (Ken) said that in jest. There're far more cryptic calls like brk.


    But "break" is a keyword.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    We must do something. This is something. Therefore, we must do this.
     
    Keith Thompson, Feb 23, 2007
    #9
  10. Re: Structure Pointer

    Coos Haak <> writes:
    [...]
    > I use a language that would have been called Fourth if the compiler had
    > allowed six letter words ;-)


    Fortran IV? :cool:}

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    We must do something. This is something. Therefore, we must do this.
     
    Keith Thompson, Feb 23, 2007
    #10
  11. RAKHE

    santosh Guest

    Re: Structure Pointer

    Keith Thompson wrote:
    > "santosh" <> writes:
    > > u plz wrote:
    > >> On Fri, 23 Feb 2007 00:06:33 -0800, jaysome wrote:
    > >> > I'm really curious as to why you chose to name your struct "creat_table"
    > >> > instead of "create_table". We had an incompetent programmer working for
    > >> > us who chose to use the same naming convention, and we always wondered
    > >> > why in the world he chose to omit the final 'e' in "create". I'm not
    > >> > saying you're incompetent--I just want to know what your rationale is
    > >> > behind choosing "creat" (which we pronounce "kreet") over "create".
    > >>
    > >> OT: Ken Thompson said this about the creat() function call in Unix:
    > >>
    > >> "If I had to do it over again? Hmm... I guess I'd spell 'creat' with an
    > >> 'e'."

    > >
    > > He (Ken) said that in jest. There're far more cryptic calls like brk.

    >
    > But "break" is a keyword.


    Indeed. But brk itself is more heavily "abbreviated", (I can't come up
    with a better term), than creat, (two vowels excised, destroying the
    pronounciation, instead of one almost redundant one.)
     
    santosh, Feb 23, 2007
    #11
  12. Re: Structure Pointer

    "santosh" <> writes:
    > Keith Thompson wrote:
    >> "santosh" <> writes:
    >> > u plz wrote:
    >> >> On Fri, 23 Feb 2007 00:06:33 -0800, jaysome wrote:
    >> >> > I'm really curious as to why you chose to name your struct
    >> >> > "creat_table" instead of "create_table". We had an incompetent
    >> >> > programmer working for us who chose to use the same naming
    >> >> > convention, and we always wondered why in the world he chose
    >> >> > to omit the final 'e' in "create". I'm not saying you're
    >> >> > incompetent--I just want to know what your rationale is behind
    >> >> > choosing "creat" (which we pronounce "kreet") over "create".
    >> >>
    >> >> OT: Ken Thompson said this about the creat() function call in Unix:
    >> >>
    >> >> "If I had to do it over again? Hmm... I guess I'd spell 'creat' with an
    >> >> 'e'."
    >> >
    >> > He (Ken) said that in jest. There're far more cryptic calls like brk.

    >>
    >> But "break" is a keyword.

    >
    > Indeed. But brk itself is more heavily "abbreviated", (I can't come up
    > with a better term), than creat, (two vowels excised, destroying the
    > pronounciation, instead of one almost redundant one.)


    Agreed, but spelling it out as "break" wasn't an option. I guess my
    point (and it's a trivial one) is that Ken Thompson was probably
    speaking in jest in that it was a humorous remark, but I suspect he
    really did wish he had spelled "creat" with an 'e'. And dropping the
    'e' from "create" does destroy the pronunciation.

    This is all quite off-topic, of course.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    We must do something. This is something. Therefore, we must do this.
     
    Keith Thompson, Feb 24, 2007
    #12
  13. RAKHE

    Ben Pfaff Guest

    Re: Structure Pointer

    Keith Thompson <> writes:

    > "santosh" <> writes:
    >> He (Ken) said that in jest. There're far more cryptic calls like brk.

    >
    > But "break" is a keyword.


    As a side note, in the 6th Edition kernel, brk was named sbreak,
    with this comment above it:

    bad planning: "break" is a dirty word in C.
    --
    "IMO, Perl is an excellent language to break your teeth on"
    --Micah Cowan
     
    Ben Pfaff, Feb 24, 2007
    #13
  14. Re: Structure Pointer

    Ben Pfaff <> writes:
    > Keith Thompson <> writes:
    >> "santosh" <> writes:
    >>> He (Ken) said that in jest. There're far more cryptic calls like brk.

    >>
    >> But "break" is a keyword.

    >
    > As a side note, in the 6th Edition kernel, brk was named sbreak,
    > with this comment above it:
    >
    > bad planning: "break" is a dirty word in C.


    Modern Unixish systems have both brk() and sbrk().

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    We must do something. This is something. Therefore, we must do this.
     
    Keith Thompson, Feb 24, 2007
    #14
  15. RAKHE

    CBFalconer Guest

    Re: [OT] Structure Pointer

    Keith Thompson wrote:
    >

    .... snip ...
    >
    > Agreed, but spelling it out as "break" wasn't an option. I guess
    > my point (and it's a trivial one) is that Ken Thompson was probably
    > speaking in jest in that it was a humorous remark, but I suspect he
    > really did wish he had spelled "creat" with an 'e'. And dropping
    > the 'e' from "create" does destroy the pronunciation.


    The last time I was in Northern Quebec I watched as the Cree ate
    their venison and fish :)

    --
    Chuck F (cbfalconer at maineline dot net)
    Available for consulting/temporary embedded and systems.
    <http://cbfalconer.home.att.net>
     
    CBFalconer, Feb 24, 2007
    #15
  16. Re: Structure Pointer

    In article <>,
    Keith Thompson <> wrote:

    >Agreed, but spelling it out as "break" wasn't an option. I guess my
    >point (and it's a trivial one) is that Ken Thompson was probably
    >speaking in jest in that it was a humorous remark, but I suspect he
    >really did wish he had spelled "creat" with an 'e'. And dropping the
    >'e' from "create" does destroy the pronunciation.


    The nature of the remark is clear if you know the context. Thompson
    was asked what he would do differently if he were designing Unix
    today.

    -- Richard
    --
    "Consideration shall be given to the need for as many as 32 characters
    in some alphabets" - X3.4, 1963.
     
    Richard Tobin, Feb 24, 2007
    #16
  17. Re: Structure Pointer

    In article <>,
    Keith Thompson <> wrote:

    >> As a side note, in the 6th Edition kernel, brk was named sbreak,
    >> with this comment above it:
    >>
    >> bad planning: "break" is a dirty word in C.


    >Modern Unixish systems have both brk() and sbrk().


    That was true in V6 too. But sbreak() in V6 was the system call used
    by both of them. It corresponds more directly to brk() than sbrk().

    You can see the code at
    ftp://ftp.win.tue.nl/pub/home/aeb/unix-archive/UnixArchive/PDP-11/Trees/V6
    in
    usr/sys/ken/sys1.c
    and
    usr/source/s5/sbrk.s

    -- Richard
    --
    "Consideration shall be given to the need for as many as 32 characters
    in some alphabets" - X3.4, 1963.
     
    Richard Tobin, Feb 24, 2007
    #17
  18. RAKHE

    Richard Bos Guest

    Re: Structure Pointer

    Coos Haak <> wrote:

    > Op Fri, 23 Feb 2007 17:31:21 +0000 (UTC) schreef u plz:
    >
    > > OT: Ken Thompson said this about the creat() function call in Unix:
    > >
    > > "If I had to do it over again? Hmm... I guess I'd spell 'creat' with an
    > > 'e'."
    > >
    > > Maybe OP got the inspiration from Ken Thompson.

    >
    > I use a language that would have been called Fourth if the compiler had
    > allowed six letter words ;-)


    I once used a language whose name is a four-letter word.

    Richard
     
    Richard Bos, Feb 26, 2007
    #18
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    10
    Views:
    717
    Chris Torek
    Feb 4, 2005
  2. jimjim
    Replies:
    16
    Views:
    852
    Jordan Abel
    Mar 28, 2006
  3. Replies:
    6
    Views:
    376
    Jack Klein
    Aug 27, 2006
  4. Replies:
    4
    Views:
    1,286
    Fred Zwarts
    Jul 2, 2009
  5. A
    Replies:
    27
    Views:
    1,646
    Jorgen Grahn
    Apr 17, 2011
Loading...

Share This Page