write a string copy function routine?
Answers were Sorted based on User's Feedback
#include<stdio.h>
#include<conio.h>
void str_cpy(const char *,const char *);
void main()
{
char a[20],b[20];
printf("enter the string for a[] :");
gets(a);
str_cpy(a,b);
printf("\nthe string for b[] is : ");
puts(b);
getch();
}
void str_cpy(const char *a,const char *b)
{
while((*a)^'\0')
{
*b=*a;
*a++;
*b++;
}
*b='\0';
}
thank u
Is This Answer Correct ? | 5 Yes | 1 No |
Answer / ragu
if we compile in turbo c its showing error like this
in that above code we cant modify a const object in function str_cpy(const char *a,const char *b)
Is This Answer Correct ? | 0 Yes | 0 No |
please give me some tips for the selection in TCS.
25. It takes five minutes to pass a rumour from one person to two other persons. The tree of rumour continues. Find how many minutes does it take spread the rumour to 768 persons. ?
11 Answers CTS, TCS,
Q. where is the below variables stored ? - volatile, static, register
What is the purpose of #pragma directives in C?
struct tag{ auto int x; static int y; };main() { struct tag s; s.x=4; s.y=5; printf(“%d”,s.x); }
a sequence of bytes with one to one corrspondence to those in the external device a) sequential addressing b) address c) byte code d) none
in C-programming language without using printf statement can we get output r not ? if yes how and if no also how ?
Prove or disprove P!=NP.
What is assignment operator?
what is the difference between entry control and exit control statement?
12 Answers Darbari Lal DAV Model School,
Write code for initializing one dimentional and two dimentional array in a C Program?
5 Answers Deshaw, Edutech, GMD,
write a program to reverse the words in the sentence.NOTE:not reverse the entire string but just the occurance of each word