Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How do you find out if a linked-list has an end? (I.e. The list is not a cycle)

1148


Which sort is best for the set: 1 2 3 5 4 a) Quick Sort b) Bubble Sort c) Merge Sort

1049


What is the extraction operator and what does it do?

1076


What is abstraction in c++?

1334


daily Routine of father

1400


What is the best c++ book?

1252


Why are pointers used?

994


What is c++ & why it is used?

1076


Explain the properties and principles of oop.

1007


How the keyword struct is different from the keyword class in c++?

1025


Refer to a name of class or function that is defined within a namespace?

1108


Is c++ primer good for beginners?

1026


What do you mean by function overriding & function overloading in c++?

1160


Does c++ support exception handling?

1048


What is anonymous object in c++?

1076