Difference between strdup and strcpy in c language?



Difference between strdup and strcpy in c language?..

Answer / kalai

strcpy - copy a string to a location YOU created (you create the location, make sure that the source string will have enough room there and afterwards use strcpy to copy)
strdup - copy a string to a location that will be created by the function. The function will allocate space, make sure that your string will fit there and copy the string. Will return a pointer to the created area.

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More Engineering AllOther Interview Questions

wht is difference b/ osi & tcp/ip model

0 Answers  


How will a tester be sure that He’s covered the entire functionality in his Test case and not missed out anything?

0 Answers  


a simple compiled code is run on a C compiler as well as java virtual machine. which runs faster and y?

3 Answers   Exilant,


What is the difference between tcp/ip protocol and IP protocol?

2 Answers   CMC, CMS, Microsoft,


a book consists of chapter ,chapter consist of sections and sections consists of subsections.construct a tree and print the node.

0 Answers  






i am student of computer science and engineering iam in 4th year suggest me about my feature?

3 Answers  


What do you mean by component versionig?

0 Answers  


to acheve the IP 65 protection class does it is mandatory to apply silicon grease?

0 Answers  


Index of an Array containing 'n' aliment varies from________to_______

0 Answers  


what are the under ground metods praticed in indian copper mines

1 Answers   HCL,


what is routing protocals & routed protocals.

2 Answers   DELL, jetking,


What is smoke testing?

1 Answers  


Categories
  • Civil Engineering Interview Questions Civil Engineering (5085)
  • Mechanical Engineering Interview Questions Mechanical Engineering (4451)
  • Electrical Engineering Interview Questions Electrical Engineering (16632)
  • Electronics Communications Interview Questions Electronics Communications (3918)
  • Chemical Engineering Interview Questions Chemical Engineering (1095)
  • Aeronautical Engineering Interview Questions Aeronautical Engineering (239)
  • Bio Engineering Interview Questions Bio Engineering (96)
  • Metallurgy Interview Questions Metallurgy (361)
  • Industrial Engineering Interview Questions Industrial Engineering (259)
  • Instrumentation Interview Questions Instrumentation (3014)
  • Automobile Engineering Interview Questions Automobile Engineering (332)
  • Mechatronics Engineering Interview Questions Mechatronics Engineering (97)
  • Marine Engineering Interview Questions Marine Engineering (124)
  • Power Plant Engineering Interview Questions Power Plant Engineering (172)
  • Textile Engineering Interview Questions Textile Engineering (575)
  • Production Engineering Interview Questions Production Engineering (25)
  • Satellite Systems Engineering Interview Questions Satellite Systems Engineering (106)
  • Engineering AllOther Interview Questions Engineering AllOther (1379)