Re: String Comparision
- From: Barry Schwarz <schwarzb@xxxxxxxxx>
- Date: Mon, 30 Apr 2007 03:43:46 -0700
On 29 Apr 2007 15:40:26 -0700, Old Wolf <oldwolf@xxxxxxxxxxxxxx>
wrote:
On Apr 30, 5:46 am, Flash Gordon <s...@xxxxxxxxxxxxxxxxxx> wrote:
Then your description of the problem is inaccurate, the code does not
modify the strings. I suggest you examine the improvements and comments
by myself and the others and see if it then works.
He never said it did. He said that "s" and "t" were modified.
Those are pointers to char, which he increments in each
loop iteration.
Yes he did. From the original message that started this thread
"On tracing the program i noticed that the strings "s" and "t" get
modified somehow in the comp function and as a result i am getting
incorrect results."
Notice "...the strings ... get modified...." In any event, it
probably means he was misinterpreting the output from his debugger.
When pointers s and t get modified (which we all agree is the actual
modification that occurs) to point past the terminating '\0'
characters, his debugger probably attempted to show him the "string"
at the new address. Since he was in the realm of undefined behavior
at this point, what the debugger showed was equally undefined and no
longer relevant to his question.
Remove del for email
.
- References:
- String Comparision
- From: user34
- Re: String Comparision
- From: Flash Gordon
- Re: String Comparision
- From: user34
- Re: String Comparision
- From: Flash Gordon
- Re: String Comparision
- From: Old Wolf
- String Comparision
- Prev by Date: Want to be a Microsoft Student Partner?
- Next by Date: Re: String Comparision
- Previous by thread: Re: String Comparision
- Next by thread: Re: String Comparision
- Index(es):
Relevant Pages
|
Loading