tag:blogger.com,1999:blog-6849619265483407528.post2836758510186176695..comments2024-03-28T21:19:24.965-07:00Comments on Programming Interview Questions and Answers: String manipulation can be funNikhil Singhalhttp://www.blogger.com/profile/03662183414943720702noreply@blogger.comBlogger15125tag:blogger.com,1999:blog-6849619265483407528.post-21816046283717228442021-01-15T01:50:23.252-08:002021-01-15T01:50:23.252-08:00Đại lý vé máy bay Aivivu
vé máy bay đi Mỹ giá bao...Đại lý vé máy bay Aivivu<br /><br /><a href="https://aivivu.com/ve-may-bay-di-my-us-gia-re-bao-nhieu-tien/" rel="nofollow">vé máy bay đi Mỹ giá bao nhiêu</a><br /><br /><a href="https://aivivu.com/ve-may-bay-tu-my-ve-viet-nam-gia-re/" rel="nofollow">vé máy bay từ mỹ về việt nam giá bao nhiêu</a><br /><br /><a href="https://aivivu.com/ve-may-bay-tu-canada-ve-viet-nam-gia-re/" rel="nofollow">từ Huongkvhttps://www.blogger.com/profile/09167457771171306382noreply@blogger.comtag:blogger.com,1999:blog-6849619265483407528.post-35211212345624023202018-09-24T09:51:57.059-07:002018-09-24T09:51:57.059-07:00Bosan Menang tidak dibayar ? judi sabung ayamBosan Menang tidak dibayar ? <a href="www.ayamvita.com" rel="nofollow"> judi sabung ayam </a>susuultrahttps://www.blogger.com/profile/02220657136041213782noreply@blogger.comtag:blogger.com,1999:blog-6849619265483407528.post-82430213256467426672018-09-15T20:31:51.375-07:002018-09-15T20:31:51.375-07:00nonton video sabung ayam bangkok<br />nonton <a href="www.sateayam.live" rel="nofollow"> video sabung ayam bangkok</a>Anonymoushttps://www.blogger.com/profile/16415256613108662549noreply@blogger.comtag:blogger.com,1999:blog-6849619265483407528.post-60893010630097565902018-05-21T02:52:42.361-07:002018-05-21T02:52:42.361-07:00Hi folks will share few tricky java string interv...Hi folks will share few tricky <a href="http://beyondcorner.com/top-20-java-string-interview-questions/" rel="nofollow">java string interview questions</a> to help freshers.<br /><br /><br />Anonymoushttps://www.blogger.com/profile/15430265906394667590noreply@blogger.comtag:blogger.com,1999:blog-6849619265483407528.post-54408541586367877172018-04-19T01:27:15.557-07:002018-04-19T01:27:15.557-07:00Hi Nikhil,
Muchas Gracias Mi Amigo! You make lear...Hi Nikhil,<br /><br />Muchas Gracias Mi Amigo! You make learning so effortless. Anyone can follow you and I would not mind following you to the moon coz I know you are like my north star.<br />So basically, I’m taking a data structures class run and long story short the teacher teaches in Java, but I only know C++. <br />My Task: "To implement object type quick sorter class that can sort Anonymoushttps://www.blogger.com/profile/02198548195213794657noreply@blogger.comtag:blogger.com,1999:blog-6849619265483407528.post-64435240730003686592015-09-30T09:39:21.713-07:002015-09-30T09:39:21.713-07:00Good post on string manipulation.For more intervie...Good post on string manipulation.For more interview questions on strings refer this link http://techno-terminal.blogspot.in/2015/09/important-string-interview-questions.htmlAnonymoushttps://www.blogger.com/profile/15672644251702841706noreply@blogger.comtag:blogger.com,1999:blog-6849619265483407528.post-4917415670653759932014-08-23T02:37:43.496-07:002014-08-23T02:37:43.496-07:00Thanks..very nice..for more string related intervi...Thanks..very nice..for more string related interview questions please go through this blog <a href="http://adnjavainterview.blogspot.in/2014/06/string-related-interview-questions.html" rel="nofollow">adnjavainterview blog</a>.<br />Anil Nivargihttps://www.blogger.com/profile/06734257637895367389noreply@blogger.comtag:blogger.com,1999:blog-6849619265483407528.post-70467786286935797122014-05-22T11:18:56.249-07:002014-05-22T11:18:56.249-07:00sizeof(char) is 1, by definition, so multiplying b...sizeof(char) is 1, by definition, so multiplying by it is bad form.<br />A string is not terminated by a NULL pointer, it is terminated by a NUL char. This mistake is a bug in the comment of the solution to the first question. The distinction may seem trivial but the use of the word 'pointer' instead of 'char' is worrisome.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6849619265483407528.post-25252803474996026192014-02-26T14:26:26.088-08:002014-02-26T14:26:26.088-08:00If the target and source are overlapping that stri...If the target and source are overlapping that string copy written above wont work. Similar to MemMove Vs MemcopyParmjeet Singhhttps://www.blogger.com/profile/11924549384123921875noreply@blogger.comtag:blogger.com,1999:blog-6849619265483407528.post-46766009446030819802013-10-13T07:43:21.190-07:002013-10-13T07:43:21.190-07:00Yes, it is true. You pass the pointer as parameter...Yes, it is true. You pass the pointer as parameter, instead of pointer to pointer, so nothing gets lost!<br />I did run the test, just I coded using C#. <br />Thank you so much! This is great post, I went through almost every topic here! I got interview next week, I hope I can run into similar question LOL!Anonymoushttps://www.blogger.com/profile/16406953291326408144noreply@blogger.comtag:blogger.com,1999:blog-6849619265483407528.post-81526024848508169362013-10-04T12:28:06.186-07:002013-10-04T12:28:06.186-07:00Yes, the assumption is that memory has been proper...Yes, the assumption is that memory has been properly allocated.Nikhil Singhalhttps://www.blogger.com/profile/03662183414943720702noreply@blogger.comtag:blogger.com,1999:blog-6849619265483407528.post-48996580713592612962013-10-04T12:27:21.641-07:002013-10-04T12:27:21.641-07:00The goal of the function is to copy the source dat...The goal of the function is to copy the source data to target. Also, it is a copy of the pointer. So nothing gets lost. I encourage to run this test yourself.Nikhil Singhalhttps://www.blogger.com/profile/03662183414943720702noreply@blogger.comtag:blogger.com,1999:blog-6849619265483407528.post-70375139769286729912013-10-04T12:19:17.685-07:002013-10-04T12:19:17.685-07:00I think the bug of String copy code is that you lo...I think the bug of String copy code is that you lost the target, Maybe you want to save the address of target somewhere before you copy everything from source to target<br />Is it a bug??Anonymoushttps://www.blogger.com/profile/16406953291326408144noreply@blogger.comtag:blogger.com,1999:blog-6849619265483407528.post-78767813622914774842012-10-29T14:02:13.585-07:002012-10-29T14:02:13.585-07:00String copy – copy source string over target
// s...String copy – copy source string over target<br /><br />// string copy - copy source string over target string<br />// can you find a possible bug in the code?<br />void StringCopy(char* target, char *source)<br />{<br /> // loop through the source string<br /> // and replace the characters in the target string<br /> while (*source)<br /> {<br /> // assign the character<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6849619265483407528.post-24079618210658436992011-06-03T13:37:26.706-07:002011-06-03T13:37:26.706-07:00The mayor bug I see (specially in the "target...The mayor bug I see (specially in the "target" string when copying or concatenating strings) is that if "target" isn't properly memory allocated it would throw an error or exception. <br /><br />For concatenation, the size of the memory allocation will be:<br />sizeof(char) * (target.lenght + source.lenght)<br /><br />Malloc for C++ lovers, Stackalloc for C# lovers :DYelinnahttp://traveling_pics.livejournal.comnoreply@blogger.com