what is the difference between strcpy() and memcpy() function?
Answers were Sorted based on User's Feedback
Answer / manoj
memcpy can copy null bytes also if the size of memory is
given
strcpy stops after the first null byte.
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / vinoth kumar
strcpy copies the data from one string to another...
memcpy copies the data's memory...
| Is This Answer Correct ? | 2 Yes | 3 No |
consider the following structure: struct num nam{ int no; char name[25]; }; struct num nam n1[]={{12,"Fred"},{15,"Martin"},{8,"Peter"},{11,Nicholas"}}; ..... ..... printf("%d%d",n1[2],no,(*(n1 + 2),no) + 1); What does the above statement print? a.8,9 b.9,9 c.8,8 d.8,unpredictable value
main() { int a=5; printf(?%d,%d,%d\n?,a,a< <2,a>>2); } Answer: 5,20,1 please explain this code in detail
Why is sprintf unsafe?
I came across some code that puts a (void) cast before each call to printf. Why?
How do you define a string?
Explain what is the benefit of using enum to declare a constant?
difference between memcpy and strcpy
What is cohesion in c?
struct node { int *a; char *b; char array[12]; }; struct node m,*n; assign the value in *a,*b,char array[12]
Develop a program that computes the new price of an item. The program should receive a character variable colour and a double precision floating-point variable price from the user. Discount rate is determined based on the colour of the discount sticker, as shown in the following table. An error message should be printed if an invalid colour has been entered
Explain what is the general form of a c program?
main() { int x=20,y=35; x = y++ + x++; y = ++y + ++x; printf("%d %d\n",x,y); } what is the output?