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

Which software is used to run c++ program?

1011


Explain "const" reference arguments in function?

1071


What are the syntactic rules to be avoid ambiguity in multiple inheritance?

1190


When should I use unitbuf flag?

1027


Function can be overloaded based on the parameter which is a value or a reference. Explain if the statement is true.

1131


What is do..while loops structure?

1160


What does iomanip mean in c++?

1211


What are all predefined data types in c++?

1136


What are manipulators used for?

1103


How do we balance an AVL Tree in C++?

1137


Write a program to find the reverse Fibonacci series starting from N.

1282


Is c++ a high level language?

1017


What is double in c++?

1074


What is an accessor in c++?

1084


What is conditions when using boolean operators?

1241