std::size_t Which header file?

Discussion in 'C++' started by JKop, Oct 11, 2004.

  1. JKop

    JKop Guest

    I'm writing a ".cpp" and ".hpp" combination.


    The ".hpp" just contains one sole function declaration.


    The ".cpp" makes use of the function "std::strlen" and the type
    "std::size_t".


    I'm wondering what header file should I include to use "std::strlen" and
    which header file should I include to use "std::size_t" ?


    -JKop
     
    JKop, Oct 11, 2004
    #1
    1. Advertising

  2. "JKop" <> wrote in message
    news:d7vad.33159$...
    >
    > I'm writing a ".cpp" and ".hpp" combination.
    >
    >
    > The ".hpp" just contains one sole function declaration.
    >
    >
    > The ".cpp" makes use of the function "std::strlen" and the type
    > "std::size_t".
    >
    >
    > I'm wondering what header file should I include to use "std::strlen" and
    > which header file should I include to use "std::size_t" ?
    >


    <cstddef> for std::size_t and <cstring> for std::strlen.

    john
     
    John Harrison, Oct 11, 2004
    #2
    1. Advertising

  3. John Harrison wrote:

    >
    > "JKop" <> wrote in message


    >> I'm wondering what header file should I include to use "std::strlen" and
    >> which header file should I include to use "std::size_t" ?
    >>

    >
    > <cstddef> for std::size_t and <cstring> for std::strlen.


    See, I told you so. There is a problem with using #includes to simulate
    what are called packages in UML terms. I actually presented size_t as an
    example.
    --
    "If our hypothesis is about anything and not about some one or more
    particular things, then our deductions constitute mathematics. Thus
    mathematics may be defined as the subject in which we never know what we
    are talking about, nor whether what we are saying is true." - Bertrand
    Russell
     
    Steven T. Hatton, Oct 12, 2004
    #3
  4. JKop

    Jerry Coffin Guest

    JKop <> wrote in message news:<d7vad.33159$>...
    > I'm writing a ".cpp" and ".hpp" combination.
    >
    >
    > The ".hpp" just contains one sole function declaration.
    >
    >
    > The ".cpp" makes use of the function "std::strlen" and the type
    > "std::size_t".
    >
    >
    > I'm wondering what header file should I include to use "std::strlen" and
    > which header file should I include to use "std::size_t" ?


    <cstring> handles both.

    --
    Later,
    Jerry.

    The universe is a figment of its own imagination.
     
    Jerry Coffin, Oct 13, 2004
    #4
    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. Pedro Graca

    #include in header file for size_t

    Pedro Graca, Jan 27, 2006, in forum: C Programming
    Replies:
    14
    Views:
    1,449
    Malcolm
    Jan 29, 2006
  2. Fei Liu
    Replies:
    9
    Views:
    446
  3. Alex Vinokur
    Replies:
    9
    Views:
    798
    James Kanze
    Oct 13, 2008
  4. , India
    Replies:
    3
    Views:
    2,864
    James Kanze
    Nov 13, 2010
  5. Alex Vinokur
    Replies:
    1
    Views:
    580
Loading...

Share This Page