Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
Answer / Ambesh Hemkar
"The strcpy() function copies a string from the source to a destination, including the null character ( ). In contrast, memcpy() is used for copying arbitrary blocks of memory. Strcpy() converts the source string into a character array (char*), while memcpy() operates on raw memory (void*). They should be used depending on whether you are dealing with strings or generic data."
| Is This Answer Correct ? | 0 Yes | 0 No |
#include<std.h> int main() { char *str[]={"Frogs","Do","Not","Die","They","Croak!"}; printf("%d %d\n",sizeof(str),strlen(str)); ...return 0; } what will the output of the above program?
What are nested functions in c?
How many header files are in c?
By using C language input a date into it and if it is right?
please help me.. how to write a code of this output?? "Enter range number:"10 1 is an odd number 2 is an even numbers 3 in an odd numbers 4 " to 10" "printing all odd numbers:" 1,3,5,7,9 "printing all even numbers:" 2,4,6,8,10 "sum of all odd numbers:25 "sum of all even numbers:30 using a C Programming ARRAY pleas pleas help.. its my project ..please :(
Explain the properties of union.
how to swap two nubers by using a function with pointers?
Why c is faster than c++?
which header file contains main() function in c?
17 Answers Google, HCL, TCS,
char p="data"; printf(p);
how can be easily placed in TCS.
What are the types of arrays in c?