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 |
What does dm mean sexually?
#define MAX 3 main() { printf("MAX = %d \n",MAX ); #undef MAX #ifdef MAX printf("Vector Instituteā); #endif
wap to print "hello world" without using the main function.
plz answer.... write a program that reads line (using getline) e.g."345", converts each line to an integer using "atoi" and computes the average of all the numbers read. also compute the standard deviation.
c program for searching a student details among 10 student details
program to get the remainder and quotant of given two numbers with out using % and / operators?
10 Answers College School Exams Tests, IBM,
Given a valid 24 hour format time find the combination of the value and write a program ,do not hard the value and if any other inputs provided should work with the logic implemented Input: 11:30 Output: 13:10 Input: 18:25 Output: 21:58
How can you return multiple values from a function?
What is the difference between ‘g’ and “g” in C?
What are file streams?
What is the purpose of #pragma directives in C?
Why cann't whole array can be passed to function as value.