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 how can you determine the size of an allocated portion of memory?
Is it better to bitshift a value than to multiply by 2?
Write a C program that will accept a hexadecimal number as input and then display a menu that will permit any of the following operations to be carried out: Display the hexadecimal equivalent of the one's complement. (b) Carry out a masking operation and then display the hexadecimal equivalent of the result. (c) Carry out a bit shifting operation and then display the hexadecimal equivalent of the result. (d) Exit. If the masking operation is selected, prompt the user lor the type of operation (bitwise and, bitwise exclusive or, or bitwise or) and then a (hexadecimal) value for the mask. If the bit shifting operation is selected. prompt the user for the type of shift (left or right), and then the number of bits. Test the program with several different (hexadecimal) input values of your own choice.
Create a structure to specify data on students given below: Roll number, Name, Department, Course, Year of joining Assume that there are not more than 450 students in the college. 1.write a function to print names of all students who joined in a particular year 2.write a function to print the data of a student whose roll number is given
What is variable in c example?
What is the difference between functions abs() and fabs()?
Why c is faster than c++?
Tell me with an example the self-referential structure?
How do you do dynamic memory allocation in C applications?
I need testPalindrome and removeSpace
#include
"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above
what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)
Write a code to generate a series where the next element is the sum of last k terms.
Draw a flowchart to produce a printed list of all the students over the age of 20 in a class .The input records contains the name and age of students. Assume a sentinel value of 99 for the age field of the trailer record
What is the general form of function in c?