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
What is identifier in c?
What are register variables in c?
What is printf () in c?
What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
we need to calculating INCOME TAX for the person. The INCOME TAX is as follows:- First $10000/- of income : 4% tax Next $10000/- of income : 8% tax Next $10000/- of income : 11.5% tax above $10, 00,00/- : 15% tax What is the Solution of this Question ?
Explain what is output redirection?
What is the hardest programming language?
What's the right way to use errno?
int i[2], j; int *pi;i[0] = 1; i[1] = 5; pi = i; j = *pi + 1 + *(pi + 1)Value of j after execution of the above statements will be a) 7 b) 6 c) 4 d) pointer
Explain modulus operator.
Explain is it better to bitshift a value than to multiply by 2?
In c programming, explain how do you insert quote characters (? And ?) Into the output screen?
.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }
What does it mean when the linker says that _end is undefined?
What are the main characteristics of c language describe the structure of ac program?