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
count = 0; for (i = 1;i < = 10; i++);count = count + i; Value of count after execution of the above statements will be a) 0 b) 11 c) 55 d) array
Explain what are multidimensional arrays?
What are c identifiers?
What is the purpose of clrscr () printf () and getch ()?
What is the hardest programming language?
Write a program on swapping (100, 50)
What are types of structure?
Write program to remove duplicate in an array?
Explain the difference between null pointer and void pointer.
Are the variables argc and argv are always local to main?
How can I direct output to the printer?
What are inbuilt functions in c?
How can variables be characterized?
the number of measuring units from a arbitrary starting point in a record area or control block to some other point a) branching b) recording pointer c) none d) offset
Why & is used in scanf in c?