String VS Code C++ (unnamed problems)

EDITED: Thanks for response and sagestions.

It's first time when i try to use VS Code . Follow this tutorial "https://code.visualstudio.com/docs/languages/cpp" i try to compile and debug my code but then i got some problems with "string variable". (i'm not sure about it, but programs works good without this and get error when i try add and use string variables).

EXAMPLE ONE

  #include <iostream>
    #include <string>

    using namespace std;

    int main()
    {
       cout<<"Text"<<endl;

        cin.ignore();
        cin.get();

        return 0;
    }

EXAMPLE TWO

 #include <iostream>
#include <string>

using namespace std;

int main()
{

    string text = "Text"; 

    cin.ignore();
    cin.get();

    return 0;
}

That first example programs work good but i have trouble with example two. The program start compaling ( i see terminal window for while) and them programs is breaking down. I don't get any errors or outputs only debug info. I get same debug info with and without #include <string>.

INFO FROM DEBUG CONSOLE

=thread-group-added,id="i1" GNU gdb (GDB) 7.6.1 Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "mingw32". For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/. =cmd-param-changed,param="pagination",value="off" [New Thread 7620.0x1a1c] gdb: unknown target exception 0xc0000139 at 0x77d8d572 ERROR: During startup program exited with code 0xc0000139. The program 'C:...\main.exe' has exited with code 0 (0x00000000).

I don't know what else is important so give me a sagestion and i will edit question.