Why can't I include the string library in C++?

This is a short one.

There's a fatal error: No library titled "string" or something like that.

#include <string>

using namespace std;

int main () {
  //[insert code here]

It should be correct, I looked how to use strings and this is exactly what to do.

1 answer

  • answered 2022-01-23 02:59 csgeek

    Make sure you are compiling it with a c++ compiler. Using a C compiler for C++ code may produce confusing error messages just like the one you got.

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum