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.
@Paul Sanders answered it for you, but just to show you what he is saying:

.h

```
#pragma once

#include <string>

class AddressType {

private:
  std::string address;
  std::string city;
  std::string state;
  int zipcode;

public:
  AddressType();
  AddressType(std::string inputAddress, std::string inputCity, std::string inputState, int inputZipcode);
};

```

.cpp

```
#include "add.h"

using namespace std;

AddressType::AddressType()
{
  address = "aa";
  city = "aa";
  state = "XX";
  zipcode = 10000;
}

AddressType::AddressType(string inputAddress, string inputCity, string inputState, int inputZipcode)
  : address(inputAddress)
  , city(inputCity)
  , state(inputState)
  , zipcode(inputZipcode)
{
  // no-op
}

```

Also unrelated to your question, a suggestion, avoid `using namespace` in your headers: ["using namespace" in c++ headers](https://stackoverflow.com/questions/5849457/using-namespace-in-c-headers)