std::size_t Which header file?

J

JKop

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
 
J

John Harrison

JKop said:
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
 
S

Steven T. Hatton

John said:
<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
 
J

Jerry Coffin

JKop said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top