char *ch = "abcde";
char c[4];
how to copy 'ch' to 'c'?
Answer Posted / gopi
main()
{
char *ch="abcd";
char c[4];
for(int i=0;i<4;i++)
{
c[i]=*ch;
ch++;
}
printf("%s",c);
getch();
}
| Is This Answer Correct ? | 12 Yes | 2 No |
Post New Answer View All Answers
Which software is used to run c++ program?
Explain "const" reference arguments in function?
What are the syntactic rules to be avoid ambiguity in multiple inheritance?
When should I use unitbuf flag?
Function can be overloaded based on the parameter which is a value or a reference. Explain if the statement is true.
What is do..while loops structure?
What does iomanip mean in c++?
What are all predefined data types in c++?
What are manipulators used for?
How do we balance an AVL Tree in C++?
Write a program to find the reverse Fibonacci series starting from N.
Is c++ a high level language?
What is double in c++?
What is an accessor in c++?
What is conditions when using boolean operators?