char *ch = "abcde";
char c[4];
how to copy 'ch' to 'c'?
Answer Posted / wade stone
#include <stdio.h>
#include <string.h>
using namespace std;
int main( )
{
char *ch = "abcde";
char c[4];
memcpy( c, ch, sizeof( c ) );
return 0;
}
Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
Do you know what is overriding?
What are multiple inheritances (virtual inheritance)?
When you overload member functions, in what ways must they differ?
What is cin clear () in c++?
What is null c++?
Do the parentheses after the type name make a difference with new?
Which programming language is best to learn first?
Is eclipse good for c++?
How to defines the function in c++?
Describe the process of creation and destruction of a derived class object?
Can manipulators fall in love?
When should overload new operator on a global basis or a class basis?
What is function overloading c++?
What is the full form of dos?
If a header file is included twice by mistake in the program, will it give any error?