Identifying this variable

I have a variable I am attempting to understand:

 
  std::vector<uint64_t>       ID


So this variable ID is of type vector<uint64_t> and it is inheriting from std? Could it be converted to a string?
Last edited on
That isn't what inheritance is. std is a namespace, which all standard library containers and functions are defined in.

To convert a uint64_t to a string, try using std::to_string.

1
2
3
4
5
6
7
8
9
10
11
// Example program
#include <iostream>
#include <string>
#include <cstdint>
#include <vector>
int main()
{
    std::vector<std::uint64_t> vt { 10, 20, 30 };  
    std::string s = std::to_string(vt[1]);
    std::cout << s << std::endl;
}
Topic archived. No new replies allowed.