Programming Help

Tom McCurdy

I am having trouble with this in C++
Code:
  while(k < bodyCopy.size())
{
bodyCopy[k] = tolower(bodyCopy[k]);
{
inTag=1;
}
if (inTag==1)
{
}

{
inTag=0;
}

k = k + 1;
}
Its supose to replace any thing in string body.Copy between < > with periods but leave everything else alone
currently it changes everything in body.Copy to periods
any idea why??

Tom McCurdy

If it would help I would post my entire code but I have a feeling that might confuse more then help solve this problem

neurocomp2003

cuz you need to use the boolean operator not the assignment operator in your "if" statement, very common mistake, i hate making that error.

also some of the code seems unnecessary unless that was your debugging technique.

Tom McCurdy

neurocomp2003 said:
cuz you need to use the boolean operator not the assignment operator in your "if" statement, very common mistake, i hate making that error.

also some of the code seems unnecessary unless that was your debugging technique.
Thank you for eyes...

I can't believe I missed that...

now only one problem left

jtbell

Mentor
I guess you must not have noticed that the next forum down, "Computers", has a sub-forum named "Programming."

The Physics Forums Way

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving