Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

string pop_back function error

I am having a problem with modifying a string. I appreciate your assistance; thank you!

struct Drawings::menues
{
    std::vector<std::string> variable;
} Menue[numMenues];


Menue[1].variable.at(0).pop_back();

the above code gives me the following error

error: 'class std::basic_string<char>' has no member named 'pop_back'|

I am using codeblocks 12.11 and am using the gnu gcc compiler and the C++11 flag under compiler settings fixed my problem.

thank you all!

like image 278
user1964975 Avatar asked Jan 26 '26 13:01

user1964975


1 Answers

pop_back was introduced in C++11. Make sure your compiler supports it and compile with -std=c++11 (or -std=c++0x only if -std=c++11 is not supported on your version of the compiler).

like image 58
chris Avatar answered Jan 28 '26 02:01

chris



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!