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
What are the advantages of c++ over c?
Keyword mean in declaration?
What is c++ similar to?
What is the difference between the compiler and the preprocessor?
program explaining feautures of c++
Why do we need function?
Why do you use the namespace feature?
What is ios flag in c++?
What is #include iostream in c++?
What is the use of endl in c++ give an example?
Write a program to show polymorphism in C++?
Is c++ proprietary?
Mention the purpose of istream class?
What is std namespace in c++?
Write a program to concatenate two strings.