1. ## Hex

Suppose i wanted to store a sieres of hexadecmial
numbers in a vector.

would i need to define it vector<int> ?

2. Depends if you want their corrosponding value or if you want to keep the actual 0x2F format.

for example.

Code:
```int main()
{
vector<int> hexs;//or Long if your doing big hex 0x3423F3
hexs.push_back(0x12);
cout<<hexs[0]<<endl;
getch();
}```
Will produce 18 as output, since its the corrosponding decimal Value.

If you want to keep the 0x12 format you could just do them as strings.

Code:
```int main()
{
vector<char *> hexs;
hexs.push_back("0x12");
cout<<hexs[0]<<endl;
getch();
}```
But clearly this doesn't allow you to get the actual hex value =P so it probably isn't what you want. but maybe it is..

If your looking for a way to add hex values... hmm you could use strings but you would have to write the calculator yourself where you would just parse the hex values and then do the math based on the characters that you pull out. <shrug>

But afaik there are no built in types with C++ that store the hex value in its actual hex form.

3. Yes, use a vector<int> container. If you need to do any output and have the results come up as hex, just use the hex stream manipulator.

Taking Charmy's example and tweaking it a bit:
Code:
```#include <iostream>
#include <iomanip>
#include <vector>
using namespace std;

int main()
{
vector<int> hexs;
hexs.push_back(0x12);
cout << hex << showbase << hexs[0] << endl;
cin.get();
return 0;
}```
Should output:
Code:
`0x12`

4. Hey cool, i learned somthing new today =). didn't know showbase did that. Very cool... Does that mean if you add to values together it will return the correct hex value?

5. thank you, both answer helped

6. Does that mean if you add to values together it will return the correct hex value?
I don't think there's any such thing as a hex value. The only thing computers know how to do is move around numbers in binary format. When you output a number in hex format, you're just telling the computer to take a binary number and make it look a certain way. How you display a value has no effect on how it is calculated internally.
Code:
```#include <iostream>
using namespace std;

int main()
{

int num = 2;

cout<<num<<endl;
cout<<hex<<showbase<<num<<endl;
cout<<oct<<showbase<<num<<endl<<endl;

int another_num = 24;

cout<<dec<<another_num<<endl;
cout<<hex<<showbase<<another_num<<endl;
cout<<oct<<showbase<<another_num<<endl<<endl;

int sum = num + another_num;

cout<<dec<<sum<<endl;
cout<<hex<<showbase<<sum<<endl;
cout<<oct<<showbase<<sum<<endl;

return 0;
}```

7. hex, decimal, binary, octal.. those are just visual representations of the numbers to be human readble. the value of a number isn't afected by it's representation