tag:blogger.com,1999:blog-2137743283716015909.post6165004598043531958..comments2024-03-03T21:03:39.924+08:00Comments on shinajaran: [DSA] STLsjteohttp://www.blogger.com/profile/09436569281310042987noreply@blogger.comBlogger23125tag:blogger.com,1999:blog-2137743283716015909.post-84288272698103033732010-11-29T13:01:43.386+08:002010-11-29T13:01:43.386+08:00@felix, now that is what i call a pointer~
->@felix, now that is what i call a pointer~<br /><br />->sjteohttps://www.blogger.com/profile/09436569281310042987noreply@blogger.comtag:blogger.com,1999:blog-2137743283716015909.post-50200228163887315302010-11-25T16:32:08.767+08:002010-11-25T16:32:08.767+08:00http://snipt.net/UJuzGtJacked/phonebook-6?key=8c15...http://snipt.net/UJuzGtJacked/phonebook-6?key=8c1547a6b29f027e4874733f66e5aa70Felix (2b03)noreply@blogger.comtag:blogger.com,1999:blog-2137743283716015909.post-44648448871511510452010-11-20T23:38:25.184+08:002010-11-20T23:38:25.184+08:00That's because the iterator is not pointing at...That's because the iterator is not pointing at the correct address. You need to move it to the correct address.HYnoreply@blogger.comtag:blogger.com,1999:blog-2137743283716015909.post-70013744002707558562010-11-20T22:38:09.310+08:002010-11-20T22:38:09.310+08:00http://snipt.net/alvinthen/stl-drill-qn?key=2930fa...http://snipt.net/alvinthen/stl-drill-qn?key=2930fa511168a0f7999ebbed06039e8e<br /><br />i manage to get the correct name but i am unable to get the correct number assigned to the name. Instead i get some ramdom numbers. Anyone can advise me on how to corectly assign the number to the names?alvinthen dcpe/ft/2b/03noreply@blogger.comtag:blogger.com,1999:blog-2137743283716015909.post-30319266661530154232010-11-20T19:15:54.067+08:002010-11-20T19:15:54.067+08:00to HY;
thx alot for the advice..its working wellto HY;<br />thx alot for the advice..its working wellalvinthen dcpe/ft/2b/03noreply@blogger.comtag:blogger.com,1999:blog-2137743283716015909.post-75916263338991487852010-11-20T18:07:41.369+08:002010-11-20T18:07:41.369+08:00You placed output code inside a nested for loop. Y...You placed output code inside a nested for loop. You only need to increment "nit" inside the previous for loop.<br /><br /> nit = Num.begin();<br /> for (it=Name.begin();it!=Name.end();it++){<br /> cout<<*it<<" "<<*nit<<" "<<endl;<br /> nit++;<br /> }HYnoreply@blogger.comtag:blogger.com,1999:blog-2137743283716015909.post-8496557605220065442010-11-20T17:26:58.752+08:002010-11-20T17:26:58.752+08:00http://snipt.net/alvinthen/stl-drill-qn?key=2930fa...http://snipt.net/alvinthen/stl-drill-qn?key=2930fa511168a0f7999ebbed06039e8e<br /><br /><br />any idea why when i type in the name and number and it returned not 1x but instead 5x??alvinthen dcpe/ft/2b/03noreply@blogger.comtag:blogger.com,1999:blog-2137743283716015909.post-62312747976382161582010-11-18T22:07:14.474+08:002010-11-18T22:07:14.474+08:00Oh and you have to use that chunk of code to repla...Oh and you have to use that chunk of code to replace this part.<br /><br />"for(it=name.begin();it!=name.end(); it++)<br /> {<br /> cout << *it<<" "<<endl;<br /><br /> }<br /> for(at=phone.begin();at!=phone.end(); at++)<br /> {<br /> cout <<*at<<endl;<br /> }"HYnoreply@blogger.comtag:blogger.com,1999:blog-2137743283716015909.post-32231001725616482812010-11-18T22:06:15.069+08:002010-11-18T22:06:15.069+08:00"at = phone.begin();
for (it=name.begin();it!..."at = phone.begin();<br />for (it=name.begin();it!=name.end(); it++)<br /> {<br /> cout << *it<<" "<<endl;<br /> cout <<*at<<endl;<br /> at++;<br /> }"<br /><br />Do you mean this when you said "tie up"? The name and number won't appear together if you're outputting the names first and then the numbers.<br /><br />What do you mean by searching the name? Do you mean finding the phone number with the name? If so, use a search algorithm and have a count setup to find it's location in the vector. Then just iterate through the number vector and output it.HYnoreply@blogger.comtag:blogger.com,1999:blog-2137743283716015909.post-85610060327413468792010-11-18T21:09:10.398+08:002010-11-18T21:09:10.398+08:00http://snipt.net/UJuzGtJacked/phonebook-6?key=8c15...http://snipt.net/UJuzGtJacked/phonebook-6?key=8c1547a6b29f027e4874733f66e5aa70<br /><br />sorry to bother again. i am stuck. cant seem to tie the name together with the number. so end up i can only search the name. i was thinking of using the memory position number(not memory address) but got no idea how to write it. any ideas?Felix (2b03)noreply@blogger.comtag:blogger.com,1999:blog-2137743283716015909.post-52321216948118154372010-11-18T10:02:48.198+08:002010-11-18T10:02:48.198+08:00@felix,
you have 2 vector, one is to track name a...@felix,<br /> you have 2 vector, one is to track name and the other to track phone num.<br /><br />and your "it" only tracks the name vector.<br /><br />to quickly solve ur prob. def it2 and points to phone.begin()<br /><br />cout in the same for loop.<br /><br />ALT, prolly you want to look at using OOP to implement the phone book.<br /><br />catchup with me on how to write it.sjteohttps://www.blogger.com/profile/09436569281310042987noreply@blogger.comtag:blogger.com,1999:blog-2137743283716015909.post-64677503081270399392010-11-17T20:51:05.492+08:002010-11-17T20:51:05.492+08:00http://snipt.net/UJuzGtJacked/phonebook-6?key=8c15...http://snipt.net/UJuzGtJacked/phonebook-6?key=8c1547a6b29f027e4874733f66e5aa70<br /><br /><br />got a problem with this assignment. i cant seem to display the phone number. any idea y?Felix (2b03)noreply@blogger.comtag:blogger.com,1999:blog-2137743283716015909.post-45977027763865426172010-11-17T20:01:11.675+08:002010-11-17T20:01:11.675+08:00http://snipt.net/jellybanana/week-5-class-exercise...http://snipt.net/jellybanana/week-5-class-exercise-1b/Yi Weihttps://www.blogger.com/profile/10037872552701524906noreply@blogger.comtag:blogger.com,1999:blog-2137743283716015909.post-49979281247324770692010-11-17T17:31:07.535+08:002010-11-17T17:31:07.535+08:00http://snipt.net/UJuzGtJacked/vector-5?key=d391971...http://snipt.net/UJuzGtJacked/vector-5?key=d3919713cc0075f00c4b85df5503628cFelix (2b03)noreply@blogger.comtag:blogger.com,1999:blog-2137743283716015909.post-90566595267338770422010-11-17T14:43:11.632+08:002010-11-17T14:43:11.632+08:00http://snipt.net/sa198/qi-haodcpe2b03-8?key=9619d5...http://snipt.net/sa198/qi-haodcpe2b03-8?key=9619d5c57cbd9dbdb66b262ced3f6d18Qi Hao(DCPE/2B/03)noreply@blogger.comtag:blogger.com,1999:blog-2137743283716015909.post-79050267960250373702010-11-16T12:38:41.793+08:002010-11-16T12:38:41.793+08:00http://snipt.net/bigshow/vector-4http://snipt.net/bigshow/vector-4XuZhounoreply@blogger.comtag:blogger.com,1999:blog-2137743283716015909.post-21567466468105126032010-11-16T12:36:28.679+08:002010-11-16T12:36:28.679+08:00http://snipt.net/tintun#addhttp://snipt.net/tintun#addtintundcpe2b03noreply@blogger.comtag:blogger.com,1999:blog-2137743283716015909.post-6025075465173928952010-11-16T12:36:14.393+08:002010-11-16T12:36:14.393+08:00http://snipt.net/Stish/stl-2http://snipt.net/Stish/stl-2Sathis 2b03noreply@blogger.comtag:blogger.com,1999:blog-2137743283716015909.post-239044670600174202010-11-16T12:31:57.323+08:002010-11-16T12:31:57.323+08:00http://snipt.net/hengnee/class-exercise-week-5http://snipt.net/hengnee/class-exercise-week-5heng gnee dcpe/ft/2b/03http://snipt.net/hengnee/class-exercise-week-5noreply@blogger.comtag:blogger.com,1999:blog-2137743283716015909.post-66113102178846506182010-11-16T12:04:20.411+08:002010-11-16T12:04:20.411+08:00http://snipt.net/jellybanana/week-5-class-exercise...http://snipt.net/jellybanana/week-5-class-exercise-1aYi Weihttps://www.blogger.com/profile/10037872552701524906noreply@blogger.comtag:blogger.com,1999:blog-2137743283716015909.post-78548916085388461402010-11-16T12:03:06.025+08:002010-11-16T12:03:06.025+08:00http://snipt.net/jellybanana/week-5-class-practice...http://snipt.net/jellybanana/week-5-class-practice-1Yi Weihttps://www.blogger.com/profile/10037872552701524906noreply@blogger.comtag:blogger.com,1999:blog-2137743283716015909.post-64604407372261881322010-11-16T10:39:22.027+08:002010-11-16T10:39:22.027+08:00Sir, how do i meet you at thursday for the revisio...Sir, how do i meet you at thursday for the revision quiz ???DCPE 2b05 Lim Guan Yannoreply@blogger.comtag:blogger.com,1999:blog-2137743283716015909.post-91817488655041318092010-11-15T19:50:03.772+08:002010-11-15T19:50:03.772+08:00sir i dono how to put in sue before betty!!!
chee...sir i dono how to put in sue before betty!!!<br /><br />cheersDouglasnoreply@blogger.com