I've been struggling to figure out what's wrong with this. Can somebody help? Using VC++ I have this code :
I get these errors :Code:#include <stdio.h> #include <iostream.h> #include <string.h> string sMyStr; int main() { sMyStr = "Hello"; return 0; }
C:\Program Files\Microsoft Visual Studio\MyProjects\jwDOS3\jwDOS3.cpp(5) : error C2146: syntax error : missing ';' before identifier 'sMyStr'
C:\Program Files\Microsoft Visual Studio\MyProjects\jwDOS3\jwDOS3.cpp(5) : error C2501: 'string' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio\MyProjects\jwDOS3\jwDOS3.cpp(5) : fatal error C1004: unexpected end of file found
![]()






Reply With Quote