Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #11461 > unrolled thread
| Started by | Alec Taylor <alec.taylor6@gmail.com> |
|---|---|
| First post | 2011-11-14 09:32 -0800 |
| Last post | 2011-11-14 10:07 -0800 |
| Articles | 3 — 2 participants |
Back to article view | Back to comp.lang.c++
Custom Longest Common Substring which includes a number fails when word appears before number Alec Taylor <alec.taylor6@gmail.com> - 2011-11-14 09:32 -0800
Re: Custom Longest Common Substring which includes a number fails when word appears before number Leigh Johnston <leigh@i42.co.uk> - 2011-11-14 17:49 +0000
Re: Custom Longest Common Substring which includes a number fails when word appears before number Alec Taylor <alec.taylor6@gmail.com> - 2011-11-14 10:07 -0800
| From | Alec Taylor <alec.taylor6@gmail.com> |
|---|---|
| Date | 2011-11-14 09:32 -0800 |
| Subject | Custom Longest Common Substring which includes a number fails when word appears before number |
| Message-ID | <15299392.40.1321291939533.JavaMail.geo-discussion-forums@prgt40> |
Good morning, Unfortunately my Custom Longest Common Substring function which includes a number failed when a word appears before the number. This one works: http://ideone.com/SSoTe This one fails: http://ideone.com/9xkB5 The second should have the same output as the first. Can you point out the bug in my code? Thanks for all suggestions, Alec Taylor
[toc] | [next] | [standalone]
| From | Leigh Johnston <leigh@i42.co.uk> |
|---|---|
| Date | 2011-11-14 17:49 +0000 |
| Message-ID | <X5qdnf9cSaMoyVzTnZ2dnUVZ8gidnZ2d@giganews.com> |
| In reply to | #11461 |
On 14/11/2011 17:32, Alec Taylor wrote: > Good morning, > > Unfortunately my Custom Longest Common Substring function which includes a number failed when a word appears before the number. > > This one works: http://ideone.com/SSoTe > > This one fails: http://ideone.com/9xkB5 > > The second should have the same output as the first. > > Can you point out the bug in my code? > > Thanks for all suggestions, As I said on IRC ".second.first.second" is so lame; your use of std::pair is gratuitous; write a class/struct instead giving the strings sensible names so that a human can parse your code and understand wtf is going on. Also posting pastebin URLs on Usenet newsgroups is a bad idea as pastebin posts tend not to be permanent (unlike newsgroup posts). HTH. /Leigh
[toc] | [prev] | [next] | [standalone]
| From | Alec Taylor <alec.taylor6@gmail.com> |
|---|---|
| Date | 2011-11-14 10:07 -0800 |
| Message-ID | <6684880.72.1321294031458.JavaMail.geo-discussion-forums@prap37> |
| In reply to | #11463 |
Okay, got it to work. http://ideone.com/9xkB5
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.c++
csiph-web