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
Explain the use of function toupper() with and example code?
Explain what is meant by 'bit masking'?
Explain the difference between exit() and _exit() function?
Explain how can I read and write comma-delimited text?
Explain what is the concatenation operator?
What is the best organizational structure?
What are the two types of structure?
What are pointers? Why are they used?
Is there any demerits of using pointer?
What is c value paradox explain?
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)
Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?
What is abstract data structure in c?
What is the difference between functions abs() and fabs()?
Why is main function so important?