Embarresingly simple struct question

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

    Embarresingly simple struct question

    Okay here is the question, what is wrong with this?

    typedef struct nntpServerInfo
    {
    char login[63];
    char password[63];
    char serverName[32];
    int port;
    } nntpServerInfo;

    int nntpConnect(nnt pServerInfo *);

    int nntpConnect(nnt pServerInfo *serverInfo)
    {
    /* Blah */
    }

    It gives me the following error:

    error: expected ) before * token

    which is odd because if I put the closing brace before the pointer star
    thingy then it no longer declares the function as excepting a pointer
    to a struct, it says it will actually take the whole struct by value
    which is not what I want.

    Any ideas? I've tried fiddling about with it and can't see what is
    going on. It is probably something dead simple but I'll be damned if I
    can see what. From what I have read it looks correct.

    --
    "I disapprove of what you say, but I'll defend to the death your right
    to say it." - Voltaire

  • Richard Tobin

    #2
    Re: Embarresingly simple struct question

    In article <20080622174321 16807-cromulent@juste xtrememetalcom> ,
    Cromulent <cromulent@just extrememetal.co mwrote:
    >Okay here is the question, what is wrong with this?
    >
    >typedef struct nntpServerInfo
    >{
    > char login[63];
    > char password[63];
    > char serverName[32];
    > int port;
    >} nntpServerInfo;
    >
    >int nntpConnect(nnt pServerInfo *);
    >
    >int nntpConnect(nnt pServerInfo *serverInfo)
    >{
    > /* Blah */
    >}
    >
    >It gives me the following error:
    >
    >error: expected ) before * token
    There is nothing obviously wrong with this fragment. So there's
    probably something wrong somewhere else.

    Give us the whole file, and the exact error message, including line
    number. And tell us what compiler you're using, with what flags.

    -- Richard
    --
    In the selection of the two characters immediately succeeding the numeral 9,
    consideration shall be given to their replacement by the graphics 10 and 11 to
    facilitate the adoption of the code in the sterling monetary area. (X3.4-1963)

    Comment

    • Johannes Bauer

      #3
      Re: Embarresingly simple struct question

      Cromulent schrieb:
      Okay here is the question, what is wrong with this?
      >
      typedef struct nntpServerInfo
      {
      char login[63];
      char password[63];
      char serverName[32];
      int port;
      } nntpServerInfo;
      >
      int nntpConnect(nnt pServerInfo *);
      >
      int nntpConnect(nnt pServerInfo *serverInfo)
      {
      /* Blah */
      }
      >
      It gives me the following error:
      Not the code above. It's fine. Your error is elsewhere.

      Regards,
      Johannes

      --
      "Wer etwas kritisiert muss es noch lange nicht selber besser können. Es
      reicht zu wissen, daß andere es besser können und andere es auch
      besser machen um einen Vergleich zu bringen." - Wolfgang Gerber
      in de.sci.electron ics <47fa8447$0$115 45$9b622d9e@new s.freenet.de>

      Comment

      Working...