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
If there are two catch statements, one for base and one for derived, which should come first?
What is type of 'this' pointer?
Is it legal in c++ to overload operator++ so that it decrements a value in your class?
What is the syntax for a for loop?
Is c better than c++?
what is Member Functions in Classes?
What is the difference between an array and a list?
What is nested class in c++?
What are the advantage of using register variables?
How are the features of c++ different from c?
What is #include math h in c++?
What is dev c++ used for?
What is operator overloading in c++ example?
Is c++ a high level language?
Why is c++ called oops?