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
Is c++ still being used?
What is a sequence in c++?
What is the rule of three?
What is fixed in c++?
What is anonymous object in c++?
Explain what you mean by a pointer.
Why do we learn c++?
What is & in c++ function?
What are c++ tokens?
Distinguish between a # include and #define.
What is else if syntax?
Describe the syntax of single inheritance in C++?
What is std :: flush?
What is dynamic and static typing?
How does c++ sort work?