Looks like header files just don't work anymore. Especially the good old <string.h>.
I made a test just to see if something was wrong... and there was.
Here's the codes that I've tried
Code:
#include <iostream>
#include <string.h>
int main()
{
string str1="Strings don't work with my Visual C++ 6.0";
cout<<str1;
return 0;
}
Code:
#include <iostream>
#include <string>
int main()
{
string str1="Strings don't work with my Visual C++ 6.0";
cout<<str1;
return 0;
}
Code:
#include <iostream>
#include <cstring>
int main()
{
string str1="Strings don't work with my Visual C++ 6.0";
cout<<str1;
return 0;
}
And as luck would have it I always get the same errors:
Code:
--------------------Configuration: Testing - Win32 Debug--------------------
Compiling...
main.cpp
c:\program files\microsoft visual studio\myprojects\testing\main.cpp(6) : error C2065: 'string' : undeclared identifier
c:\program files\microsoft visual studio\myprojects\testing\main.cpp(6) : error C2146: syntax error : missing ';' before identifier 'str1'
c:\program files\microsoft visual studio\myprojects\testing\main.cpp(6) : error C2065: 'str1' : undeclared identifier
c:\program files\microsoft visual studio\myprojects\testing\main.cpp(6) : error C2440: '=' : cannot convert from 'char [42]' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
c:\program files\microsoft visual studio\myprojects\testing\main.cpp(7) : error C2065: 'cout' : undeclared identifier
c:\program files\microsoft visual studio\myprojects\testing\main.cpp(7) : warning C4552: '<<' : operator has no effect; expected operator with side-effect
Error executing cl.exe.
Testing.exe - 5 error(s), 1 warning(s)
So what's wrong with my Visual C++ and is there any other way to fix it besides re-installing it? Or am i just stupid? (please don't say that because it won't really help the situation even though it could be true)