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 / wade stone

#include <stdio.h>
#include <string.h>

using namespace std;

int main( )
{
char *ch = "abcde";
char c[4];

memcpy( c, ch, sizeof( c ) );

return 0;
}

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If there are two catch statements, one for base and one for derived, which should come first?

986


What is type of 'this' pointer?

1002


Is it legal in c++ to overload operator++ so that it decrements a value in your class?

1006


What is the syntax for a for loop?

1066


Is c better than c++?

1017


what is Member Functions in Classes?

1108


What is the difference between an array and a list?

974


What is nested class in c++?

893


What are the advantage of using register variables?

1110


How are the features of c++ different from c?

1013


What is #include math h in c++?

1024


What is dev c++ used for?

972


What is operator overloading in c++ example?

1044


Is c++ a high level language?

940


Why is c++ called oops?

1073