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
How do you find out if a linked-list has an end? (I.e. The list is not a cycle)
Which sort is best for the set: 1 2 3 5 4 a) Quick Sort b) Bubble Sort c) Merge Sort
What is the extraction operator and what does it do?
What is abstraction in c++?
daily Routine of father
What is the best c++ book?
Why are pointers used?
What is c++ & why it is used?
Explain the properties and principles of oop.
How the keyword struct is different from the keyword class in c++?
Refer to a name of class or function that is defined within a namespace?
Is c++ primer good for beginners?
What do you mean by function overriding & function overloading in c++?
Does c++ support exception handling?
What is anonymous object in c++?