In the following code, I'm getting only string a as output on my mingw compiler but I get both strings as output on an online compiler. Why am I not getting appropriate output on my system?
#include<iostream>
#include<cstring>
using namespace std;
int main(){
    string a="Welcome";
    string b="HelloWorld";
    for(int i=0;i<=b.length();i++){
        a.push_back(b[i]);
        
    }
    cout<<a<<endl<<b;
     
    return 0;   
}    
Output- WelcomeHelloWorld