Declaring vectors in a C++ header file

后端 未结 3 1634
甜味超标
甜味超标 2021-02-02 13:14

I am having some trouble with vector declarations in the header file of a C++ class I am making. My entire header file looks like this:

#ifndef PERSON_H
#define          


        
相关标签:
3条回答
  • 2021-02-02 14:04

    You're missing the namespace:

    std::vector
    
    0 讨论(0)
  • 2021-02-02 14:05

    In my case, adding the namespace did not work, however, I was missing the

    #include <vector>;
    
    0 讨论(0)
  • 2021-02-02 14:11

    You need to put 'std::' before 'vector' just like you did with string.

    0 讨论(0)
提交回复
热议问题