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...

code for copying two strings with out strcpy() function.

Answer Posted / rohit

#include<iostream>
using namespace std;
int main()
{
int i;
char str1[10]="rohit";
char str2[10]="sinsinwar";
void strcpy(char,char);
cout<<str2;
return 0;
}
void strcpy(char str1[],char str2[])
{
int i=0;
while(str1[i]!='\0')
{
str2[i]=str1[i];
i++;
}
str2[i]='\0';
}
//whats the problem in this code...would u please suggest asap..

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the use of function toupper() with and example code?

1122


Explain what is meant by 'bit masking'?

1190


Explain the difference between exit() and _exit() function?

1164


Explain how can I read and write comma-delimited text?

1159


Explain what is the concatenation operator?

1161


What is the best organizational structure?

1119


What are the two types of structure?

1083


What are pointers? Why are they used?

1175


Is there any demerits of using pointer?

1066


What is c value paradox explain?

1084


Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)

1146


Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?

1118


What is abstract data structure in c?

1034


What is the difference between functions abs() and fabs()?

1146


Why is main function so important?

1097