What is the equivalent of strcpy in c++ and do I have to use a .h for it??
What is the equivalent of strcpy in c++ and do I have to use a .h for it??
>> What is the equivalent of strcpy in c++ and do I have to use a .h for it??
I'd say strcpy() in string.h
Some things just don't change.
And also std::strcpy() in <cstring> right?
"Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
-Christopher Hitchens
I am using a c program with strcpy I want to convert it to c++ but I don't know the code for strcpy in C++
can anyone help
actually, wouldn't this be the equivalent?
where st1 and st2 are std::string ?Code:str1 = str2;
always looking, make an offer. get me out of this place.
Only if they're declared as strings and not char*/char[], I think.actually, wouldn't this be the equivalent?
code:--------------------------------------------------------------------------------
str1 = str2;
Turn no more aside and brood
Upon love's bitter mysteries
For Fergus rules the brazen cars...
right, but a lot of people are looking for so-called C++ equivalences so I suppose it could be said that
char [] == std::string in C++
I don't really agree. I think C is mostly contained by C++ so I agree with TheDog on that one.
strcpy() == strcpy() in C++ as C is a rough subset of C++
always looking, make an offer. get me out of this place.