Question: I have an address in a block of html that has all it's parts divided between multiple spans. I want the address as a single string, how do I strip out the spans?

```
<div class="AddressInfo">
 <span class="AddressNumber">2222 </span>
 <span class="AddressDirection"></span>
 <span class="AddressName">Turtle Creek Boulevard</span>
 <span class="AddressUnitNumber">5E</span>
 <span class="EndAddressComma">,&nbsp;</span>
</div>

```

I don't want the comma and I don't need any empty spans, just the text as one single string in a new var. 

I've gotten as far as grabbing AddressInfo by getElementsByClassName so now I have this html block to work with. If there's a better way I'd be very grateful to learn it.

Thanks!

Answer: 
You need to do two things:

* get rid of the definition of `addressType` in the .cpp file completely
* prefix the methods that make up the class with `addressType::`, e.g. `void addressType::setAddress(string inputAddress) {...`

In that way, you define the class only once (which is a requirement, in any single translation unit), and you tell the compiler to which class the method bodies belong.
> 
> Why does it think I'm redeclaring the class?
> 
> 
> 

Because you are.

More specifically though, redeclaration is not a problem. Redefinition is the problem. The first definition is in the `addressType.h` file. You include this file into "the .cpp" and then redefine `addressType`. This violates the one definition rule.

The solution is to not define the class more than once.