I am making a windows app but the compiler returns the errors while using cout:
I have using namespace std;
error C2143: syntax error : missing ';' before '<<' (no semicolon is missing)
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (how does that apply?)
error C2086: 'int cout' : redefinition
: see declaration of 'cout' why do i have to decalre cout? anyway here is the code segment
it does seem that way but i have been over the code a million times. None missing. For all eight cout messages I get the same three errors and their are semi colon and the end of all those lines.
Do you have usingnamespace std;? If not, then you must fully qualify "cout" as std::cout. I would recommend not having usingnamespace <anything>; anyway; but this seems to be the mistake you've made.
thanks for replying. I do have using namespace std; do you think if i take it out and use the std::it would make a difference? Would having the both of them present a conflict?
I doubt it would help if you do, but like I said; I think you should use the std:: prefix anyway. It's useful for avoiding name errors and what-not. It takes a little getting used to, you have to remember what's in the std namespace and what isn't, but when you get used to it it's fine.
I tried dropping using namespace and used std:: instead. It opened the flood gates to alot of errors and I still got the three errors from first post hmmmmmm. I tried googling this too and it seems that others had this problem too but I cant seem to find a solution. I guess the better question would be what is the best way to display variable solution in the window once the program is exectuted?