Hewlett Packard Interview Question
Tech LeadsCountry: India
Interview Type: In-Person
is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.
CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.
Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.
Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.
Hi, I think following code serves the purpose:
Function parameters include source and target, both pointers to char or char array. source remains unchanged while processing so it is declared as const.
- soni.komal712 August 06, 2015It returns char * therefore it can be used directly in printf() like functions.
Yes it has been assumed that destination string is large enough and initialized, else there would be foloowing problems:
-->It might be pointing at memory you don't have access to, in which case it causes a segmentation fault and crashes your program
--> It might be pointing at real data, and if you don't know what it's pointing to, you're causing unpredictable (and very hard to debug) changes to your data.
-->You have no way of knowing if it's been initialized or not - because how do you tell the difference between a valid address and the address that happened to be there when you declared the pointer?