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

Does c++ have arraylist?

1035


What are keywords in c++?

1102


If you hear the cpu fan is running and the monitor power is still on, but you did not see anything show up in the monitor screen. What would you do to find out what is going wrong?

1137


Write a note about the virtual member function?

1066


What is static class data?

1069


What is the outcome of cout< a) 16 b) 17 c) 16.5

1022


How do you invoke a base member function from a derived class in which you’ve overridden that function?

1121


What is an overflow error?

1112


Describe private, protected and public – the differences and give examples.

1201


What is the difference between global int and static int declaration?

1068


What is the use of seekg in c++?

1061


Explain what is polymorphism in c++?

1131


What is the last index number in an array of 100 characters a) 100 b) 99 c) 101

1154


What does namespace mean in c++?

1080


What is the difference between method overloading and method overriding in c++?

1155