#include<iostream>
using namespace std;
int main()
{
char a[5],b[5];
cout<<strlen(a)<<endl;
strcpy(a,b);
}
when I compile the code using g++ filename.cpp the code will be compiled with no issues but when my friends try to do it using dev-c++, they'll get errors!
based on cplusplus.com, I am the one who should get errors!!
so I am just wondering what's causing the difference here?
P.S: I have tried different versions of C++ using -std=c++98 throw -std=c++2a
strlen and strcpy are declared in the <cstring> header. Some standard library implementations might include that in <iostream>, some might not. This explains why it may compile with some setups and not others.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With